react-bootstrap 1.5.0 → 1.6.1
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.d.ts +10 -0
- package/cjs/AbstractNav.js +7 -3
- package/cjs/AbstractNavItem.d.ts +2 -1
- package/cjs/AbstractNavItem.js +7 -3
- package/cjs/Accordion.js +3 -1
- package/cjs/AccordionBody.d.ts +6 -0
- package/cjs/AccordionButton.d.ts +8 -0
- package/cjs/AccordionCollapse.js +7 -3
- package/cjs/AccordionHeader.d.ts +6 -0
- package/cjs/AccordionItem.d.ts +7 -0
- package/cjs/AccordionItemContext.d.ts +6 -0
- package/cjs/AccordionToggle.js +7 -3
- package/cjs/Alert.d.ts +1 -1
- package/cjs/Alert.js +2 -1
- package/cjs/Badge.js +2 -1
- package/cjs/Breadcrumb.js +2 -1
- package/cjs/BreadcrumbItem.js +2 -1
- package/cjs/Button.js +2 -1
- package/cjs/ButtonGroup.js +2 -1
- package/cjs/ButtonToolbar.js +2 -1
- package/cjs/Card.d.ts +2 -2
- package/cjs/Card.js +7 -3
- package/cjs/CardHeader.d.ts +6 -0
- package/cjs/CardHeaderContext.d.ts +6 -0
- package/cjs/CardImg.js +2 -1
- package/cjs/Carousel.js +11 -7
- package/cjs/CarouselItem.js +3 -1
- package/cjs/CloseButton.js +2 -1
- package/cjs/Col.js +2 -1
- package/cjs/Collapse.d.ts +1 -2
- package/cjs/Collapse.js +7 -3
- package/cjs/Container.js +2 -1
- package/cjs/Dropdown.js +12 -11
- package/cjs/DropdownButton.js +7 -3
- package/cjs/DropdownContext.d.ts +7 -0
- package/cjs/DropdownItem.d.ts +2 -1
- package/cjs/DropdownItem.js +8 -5
- package/cjs/DropdownMenu.js +23 -14
- package/cjs/DropdownToggle.d.ts +0 -1
- package/cjs/DropdownToggle.js +4 -4
- package/cjs/Fade.js +7 -3
- package/cjs/Feedback.js +2 -1
- package/cjs/FigureImage.js +7 -3
- package/cjs/FloatingLabel.d.ts +9 -0
- package/cjs/Form.js +2 -1
- package/cjs/FormCheck.js +7 -3
- package/cjs/FormCheckInput.js +7 -3
- package/cjs/FormCheckLabel.js +7 -3
- package/cjs/FormControl.js +7 -3
- package/cjs/FormFile.js +7 -3
- package/cjs/FormFileInput.js +7 -3
- package/cjs/FormFileLabel.js +7 -3
- package/cjs/FormFloating.d.ts +2 -0
- package/cjs/FormGroup.js +7 -3
- package/cjs/FormLabel.js +8 -3
- package/cjs/FormRange.d.ts +6 -0
- package/cjs/FormSelect.d.ts +10 -0
- package/cjs/FormText.js +3 -1
- package/cjs/Image.js +2 -1
- package/cjs/InputGroup.js +2 -1
- package/cjs/InputGroupContext.d.ts +3 -0
- package/cjs/Jumbotron.js +2 -1
- package/cjs/ListGroup.d.ts +3 -2
- package/cjs/ListGroup.js +2 -1
- package/cjs/ListGroupItem.d.ts +2 -2
- package/cjs/ListGroupItem.js +8 -9
- package/cjs/Media.js +2 -1
- package/cjs/Modal.js +15 -7
- package/cjs/ModalDialog.js +3 -1
- package/cjs/ModalHeader.js +7 -3
- package/cjs/ModalTitle.d.ts +1 -1
- package/cjs/Nav.d.ts +4 -2
- package/cjs/Nav.js +9 -4
- package/cjs/NavDropdown.js +3 -1
- package/cjs/NavItem.js +3 -1
- package/cjs/NavLink.d.ts +2 -1
- package/cjs/NavLink.js +2 -1
- package/cjs/Navbar.js +7 -3
- package/cjs/NavbarBrand.js +3 -1
- package/cjs/NavbarCollapse.js +3 -1
- package/cjs/NavbarToggle.js +7 -3
- package/cjs/Offcanvas.d.ts +16 -0
- package/cjs/OffcanvasBody.d.ts +2 -0
- package/cjs/OffcanvasHeader.d.ts +7 -0
- package/cjs/OffcanvasTitle.d.ts +3 -0
- package/cjs/OffcanvasToggling.d.ts +14 -0
- package/cjs/Overlay.js +9 -4
- package/cjs/OverlayTrigger.js +9 -4
- package/cjs/PageItem.js +4 -3
- package/cjs/Pagination.js +7 -3
- package/cjs/Popover.js +2 -1
- package/cjs/PopoverBody.d.ts +2 -0
- package/cjs/PopoverContent.js +3 -1
- package/cjs/PopoverHeader.d.ts +2 -0
- package/cjs/PopoverTitle.js +3 -1
- package/cjs/ProgressBar.js +12 -5
- package/cjs/Ratio.d.ts +9 -0
- package/cjs/ResponsiveEmbed.js +2 -1
- package/cjs/Row.js +2 -1
- package/cjs/SafeAnchor.d.ts +0 -1
- package/cjs/SafeAnchor.js +3 -1
- package/cjs/SelectableContext.d.ts +1 -1
- package/cjs/Spinner.d.ts +0 -1
- package/cjs/Spinner.js +3 -1
- package/cjs/SplitButton.js +2 -1
- package/cjs/Tab.d.ts +5 -3
- package/cjs/TabContainer.d.ts +6 -5
- package/cjs/TabContainer.js +4 -2
- package/cjs/TabContent.js +3 -1
- package/cjs/TabPane.d.ts +2 -1
- package/cjs/TabPane.js +9 -4
- package/cjs/Table.js +3 -1
- package/cjs/Tabs.d.ts +3 -2
- package/cjs/Tabs.js +2 -1
- package/cjs/ThemeProvider.js +4 -2
- package/cjs/Toast.js +7 -3
- package/cjs/ToastContainer.d.ts +8 -0
- package/cjs/ToastHeader.js +7 -3
- package/cjs/ToggleButton.js +7 -3
- package/cjs/ToggleButtonGroup.js +2 -1
- package/cjs/Tooltip.js +2 -1
- package/cjs/TransitionWrapper.d.ts +8 -0
- package/cjs/createWithBsPrefix.js +3 -1
- package/cjs/divWithClassName.d.ts +1 -1
- package/cjs/index.js +5 -3
- package/cjs/transitionEndListener.js +11 -1
- package/cjs/types.d.ts +1 -0
- package/cjs/types.js +3 -1
- package/cjs/useOverlayOffset.d.ts +6 -0
- package/cjs/usePopperMarginModifiers.js +48 -13
- package/dist/react-bootstrap.js +3074 -2690
- package/dist/react-bootstrap.min.js +2 -6
- package/dist/react-bootstrap.min.js.LICENSE.txt +5 -0
- package/esm/AbstractModalHeader.d.ts +10 -0
- package/esm/AbstractNav.js +2 -1
- package/esm/AbstractNavItem.d.ts +2 -1
- package/esm/AbstractNavItem.js +2 -1
- package/esm/Accordion.js +2 -1
- package/esm/AccordionBody.d.ts +6 -0
- package/esm/AccordionButton.d.ts +8 -0
- package/esm/AccordionCollapse.js +2 -1
- package/esm/AccordionHeader.d.ts +6 -0
- package/esm/AccordionItem.d.ts +7 -0
- package/esm/AccordionItemContext.d.ts +6 -0
- package/esm/AccordionToggle.js +2 -1
- package/esm/Alert.d.ts +1 -1
- package/esm/Alert.js +2 -1
- package/esm/Badge.js +2 -1
- package/esm/Breadcrumb.js +2 -1
- package/esm/BreadcrumbItem.js +2 -1
- package/esm/Button.js +2 -1
- package/esm/ButtonGroup.js +2 -1
- package/esm/ButtonToolbar.js +2 -1
- package/esm/Card.d.ts +2 -2
- package/esm/Card.js +2 -1
- package/esm/CardHeader.d.ts +6 -0
- package/esm/CardHeaderContext.d.ts +6 -0
- package/esm/CardImg.js +2 -1
- package/esm/Carousel.js +5 -4
- package/esm/CarouselItem.js +2 -1
- package/esm/CloseButton.js +2 -1
- package/esm/Col.js +2 -1
- package/esm/Collapse.d.ts +1 -2
- package/esm/Collapse.js +2 -1
- package/esm/Container.js +2 -1
- package/esm/Dropdown.js +7 -9
- package/esm/DropdownButton.js +2 -1
- package/esm/DropdownContext.d.ts +7 -0
- package/esm/DropdownItem.d.ts +2 -1
- package/esm/DropdownItem.js +3 -3
- package/esm/DropdownMenu.js +18 -13
- package/esm/DropdownToggle.d.ts +0 -1
- package/esm/DropdownToggle.js +3 -4
- package/esm/Fade.js +2 -1
- package/esm/Feedback.js +2 -1
- package/esm/FigureImage.js +2 -1
- package/esm/FloatingLabel.d.ts +9 -0
- package/esm/Form.js +2 -1
- package/esm/FormCheck.js +2 -1
- package/esm/FormCheckInput.js +2 -1
- package/esm/FormCheckLabel.js +2 -1
- package/esm/FormControl.js +2 -1
- package/esm/FormFile.js +2 -1
- package/esm/FormFileInput.js +2 -1
- package/esm/FormFileLabel.js +2 -1
- package/esm/FormFloating.d.ts +2 -0
- package/esm/FormGroup.js +2 -1
- package/esm/FormLabel.js +3 -1
- package/esm/FormRange.d.ts +6 -0
- package/esm/FormSelect.d.ts +10 -0
- package/esm/FormText.js +2 -1
- package/esm/Image.js +2 -1
- package/esm/InputGroup.js +2 -1
- package/esm/InputGroupContext.d.ts +3 -0
- package/esm/Jumbotron.js +2 -1
- package/esm/ListGroup.d.ts +3 -2
- package/esm/ListGroup.js +2 -1
- package/esm/ListGroupItem.d.ts +2 -2
- package/esm/ListGroupItem.js +3 -6
- package/esm/Media.js +2 -1
- package/esm/Modal.js +9 -4
- package/esm/ModalDialog.js +2 -1
- package/esm/ModalHeader.js +2 -1
- package/esm/ModalTitle.d.ts +1 -1
- package/esm/Nav.d.ts +4 -2
- package/esm/Nav.js +4 -2
- package/esm/NavDropdown.js +2 -1
- package/esm/NavItem.js +2 -1
- package/esm/NavLink.d.ts +2 -1
- package/esm/NavLink.js +2 -1
- package/esm/Navbar.js +2 -1
- package/esm/NavbarBrand.js +2 -1
- package/esm/NavbarCollapse.js +2 -1
- package/esm/NavbarToggle.js +2 -1
- package/esm/Offcanvas.d.ts +16 -0
- package/esm/OffcanvasBody.d.ts +2 -0
- package/esm/OffcanvasHeader.d.ts +7 -0
- package/esm/OffcanvasTitle.d.ts +3 -0
- package/esm/OffcanvasToggling.d.ts +14 -0
- package/esm/Overlay.js +4 -2
- package/esm/OverlayTrigger.js +4 -2
- package/esm/PageItem.js +4 -2
- package/esm/Pagination.js +2 -1
- package/esm/Popover.js +2 -1
- package/esm/PopoverBody.d.ts +2 -0
- package/esm/PopoverContent.js +2 -1
- package/esm/PopoverHeader.d.ts +2 -0
- package/esm/PopoverTitle.js +2 -1
- package/esm/ProgressBar.js +7 -3
- package/esm/Ratio.d.ts +9 -0
- package/esm/ResponsiveEmbed.js +2 -1
- package/esm/Row.js +2 -1
- package/esm/SafeAnchor.d.ts +0 -1
- package/esm/SafeAnchor.js +2 -1
- package/esm/SelectableContext.d.ts +1 -1
- package/esm/Spinner.d.ts +0 -1
- package/esm/Spinner.js +2 -1
- package/esm/SplitButton.js +2 -1
- package/esm/Tab.d.ts +5 -3
- package/esm/TabContainer.d.ts +6 -5
- package/esm/TabContent.js +2 -1
- package/esm/TabPane.d.ts +2 -1
- package/esm/TabPane.js +4 -2
- package/esm/Table.js +2 -1
- package/esm/Tabs.d.ts +3 -2
- package/esm/Tabs.js +2 -1
- package/esm/Toast.js +2 -1
- package/esm/ToastContainer.d.ts +8 -0
- package/esm/ToastHeader.js +2 -1
- package/esm/ToggleButton.js +2 -1
- package/esm/ToggleButtonGroup.js +2 -1
- package/esm/Tooltip.js +2 -1
- package/esm/TransitionWrapper.d.ts +8 -0
- package/esm/createWithBsPrefix.js +2 -1
- package/esm/divWithClassName.d.ts +1 -1
- package/esm/transitionEndListener.js +11 -1
- package/esm/types.d.ts +1 -0
- package/esm/types.js +1 -0
- package/esm/useOverlayOffset.d.ts +6 -0
- package/esm/usePopperMarginModifiers.js +48 -13
- package/package.json +9 -15
package/esm/Spinner.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "variant", "animation", "size", "children", "as", "className"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
@@ -12,7 +13,7 @@ var Spinner = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
12
13
|
_ref$as = _ref.as,
|
|
13
14
|
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
14
15
|
className = _ref.className,
|
|
15
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
16
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
17
|
|
|
17
18
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'spinner');
|
|
18
19
|
var bsSpinnerPrefix = bsPrefix + "-" + animation;
|
package/esm/SplitButton.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["id", "bsPrefix", "size", "variant", "title", "type", "toggleLabel", "children", "onClick", "href", "target", "menuAlign", "menuRole", "renderMenuOnMount", "rootCloseEvent"];
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
6
|
import Button from './Button';
|
|
@@ -99,7 +100,7 @@ var SplitButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
99
100
|
menuRole = _ref.menuRole,
|
|
100
101
|
renderMenuOnMount = _ref.renderMenuOnMount,
|
|
101
102
|
rootCloseEvent = _ref.rootCloseEvent,
|
|
102
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
103
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
103
104
|
|
|
104
105
|
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
105
106
|
ref: ref
|
package/esm/Tab.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import TabContent from './TabContent';
|
|
4
4
|
import TabPane from './TabPane';
|
|
5
|
+
import { EventKey } from './types';
|
|
5
6
|
export interface TabProps extends React.ComponentPropsWithRef<typeof TabPane> {
|
|
6
|
-
eventKey?:
|
|
7
|
+
eventKey?: EventKey;
|
|
7
8
|
title: React.ReactNode;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
tabClassName?: string;
|
|
@@ -11,17 +12,18 @@ export interface TabProps extends React.ComponentPropsWithRef<typeof TabPane> {
|
|
|
11
12
|
declare class Tab extends React.Component<TabProps> {
|
|
12
13
|
static propTypes: {
|
|
13
14
|
title: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
15
|
+
eventKey: PropTypes.Requireable<string | number>;
|
|
14
16
|
};
|
|
15
17
|
static Container: {
|
|
16
18
|
(props: import("./TabContainer").TabContainerProps): JSX.Element;
|
|
17
19
|
propTypes: {
|
|
18
20
|
id: PropTypes.Validator<string>;
|
|
19
|
-
transition: PropTypes.Requireable<
|
|
21
|
+
transition: PropTypes.Requireable<boolean | PropTypes.ReactComponentLike>;
|
|
20
22
|
mountOnEnter: PropTypes.Requireable<boolean>;
|
|
21
23
|
unmountOnExit: PropTypes.Requireable<boolean>;
|
|
22
24
|
generateChildId: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
25
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
|
-
activeKey: PropTypes.Requireable<
|
|
26
|
+
activeKey: PropTypes.Requireable<string | number>;
|
|
25
27
|
};
|
|
26
28
|
};
|
|
27
29
|
static Content: TabContent;
|
package/esm/TabContainer.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { SelectCallback, TransitionType } from './helpers';
|
|
4
|
+
import { EventKey } from './types';
|
|
4
5
|
export interface TabContainerProps extends React.PropsWithChildren<unknown> {
|
|
5
6
|
id?: string;
|
|
6
7
|
transition?: TransitionType;
|
|
7
8
|
mountOnEnter?: boolean;
|
|
8
9
|
unmountOnExit?: boolean;
|
|
9
|
-
generateChildId?: (eventKey:
|
|
10
|
+
generateChildId?: (eventKey: EventKey, type: 'tab' | 'pane') => string;
|
|
10
11
|
onSelect?: SelectCallback;
|
|
11
|
-
activeKey?:
|
|
12
|
-
defaultActiveKey?:
|
|
12
|
+
activeKey?: EventKey;
|
|
13
|
+
defaultActiveKey?: EventKey;
|
|
13
14
|
}
|
|
14
15
|
declare const TabContainer: {
|
|
15
16
|
(props: TabContainerProps): JSX.Element;
|
|
@@ -29,7 +30,7 @@ declare const TabContainer: {
|
|
|
29
30
|
* @type {{Transition | false}}
|
|
30
31
|
* @default {Fade}
|
|
31
32
|
*/
|
|
32
|
-
transition: PropTypes.Requireable<
|
|
33
|
+
transition: PropTypes.Requireable<boolean | PropTypes.ReactComponentLike>;
|
|
33
34
|
/**
|
|
34
35
|
* Wait until the first "enter" transition to mount tabs (add them to the DOM)
|
|
35
36
|
*/
|
|
@@ -61,7 +62,7 @@ declare const TabContainer: {
|
|
|
61
62
|
*
|
|
62
63
|
* @controllable onSelect
|
|
63
64
|
*/
|
|
64
|
-
activeKey: PropTypes.Requireable<
|
|
65
|
+
activeKey: PropTypes.Requireable<string | number>;
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
export default TabContainer;
|
package/esm/TabContent.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "as", "className"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
@@ -8,7 +9,7 @@ var TabContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
8
9
|
_ref$as = _ref.as,
|
|
9
10
|
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
10
11
|
className = _ref.className,
|
|
11
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
12
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
12
13
|
|
|
13
14
|
var decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'tab-content');
|
|
14
15
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
package/esm/TabPane.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BsPrefixProps, BsPrefixRefForwardingComponent, TransitionCallbacks, TransitionType } from './helpers';
|
|
2
|
+
import { EventKey } from './types';
|
|
2
3
|
export interface TabPaneProps extends TransitionCallbacks, BsPrefixProps {
|
|
3
|
-
eventKey?:
|
|
4
|
+
eventKey?: EventKey;
|
|
4
5
|
active?: boolean;
|
|
5
6
|
transition?: TransitionType;
|
|
6
7
|
mountOnEnter?: boolean;
|
package/esm/TabPane.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["activeKey", "getControlledId", "getControllerId"],
|
|
4
|
+
_excluded2 = ["bsPrefix", "className", "active", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "mountOnEnter", "unmountOnExit", "transition", "as", "eventKey"];
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import React, { useContext } from 'react';
|
|
5
7
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
@@ -14,7 +16,7 @@ function useTabContext(props) {
|
|
|
14
16
|
var activeKey = context.activeKey,
|
|
15
17
|
getControlledId = context.getControlledId,
|
|
16
18
|
getControllerId = context.getControllerId,
|
|
17
|
-
rest = _objectWithoutPropertiesLoose(context,
|
|
19
|
+
rest = _objectWithoutPropertiesLoose(context, _excluded);
|
|
18
20
|
|
|
19
21
|
var shouldTransition = props.transition !== false && rest.transition !== false;
|
|
20
22
|
var key = makeEventKey(props.eventKey);
|
|
@@ -45,7 +47,7 @@ var TabPane = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
45
47
|
_useTabContext$as = _useTabContext.as,
|
|
46
48
|
Component = _useTabContext$as === void 0 ? 'div' : _useTabContext$as,
|
|
47
49
|
_ = _useTabContext.eventKey,
|
|
48
|
-
rest = _objectWithoutPropertiesLoose(_useTabContext,
|
|
50
|
+
rest = _objectWithoutPropertiesLoose(_useTabContext, _excluded2);
|
|
49
51
|
|
|
50
52
|
var prefix = useBootstrapPrefix(bsPrefix, 'tab-pane');
|
|
51
53
|
if (!active && !Transition && unmountOnExit) return null;
|
package/esm/Table.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "className", "striped", "bordered", "borderless", "hover", "size", "variant", "responsive"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
@@ -13,7 +14,7 @@ var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13
14
|
size = _ref.size,
|
|
14
15
|
variant = _ref.variant,
|
|
15
16
|
responsive = _ref.responsive,
|
|
16
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
17
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
17
18
|
|
|
18
19
|
var decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'table');
|
|
19
20
|
var classes = classNames(className, decoratedBsPrefix, variant && decoratedBsPrefix + "-" + variant, size && decoratedBsPrefix + "-" + size, striped && decoratedBsPrefix + "-striped", bordered && decoratedBsPrefix + "-bordered", borderless && decoratedBsPrefix + "-borderless", hover && decoratedBsPrefix + "-hover");
|
package/esm/Tabs.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectCallback, TransitionType } from './helpers';
|
|
3
|
+
import { EventKey } from './types';
|
|
3
4
|
export interface TabsProps extends React.PropsWithChildren<unknown> {
|
|
4
|
-
activeKey?:
|
|
5
|
-
defaultActiveKey?:
|
|
5
|
+
activeKey?: EventKey;
|
|
6
|
+
defaultActiveKey?: EventKey;
|
|
6
7
|
onSelect?: SelectCallback;
|
|
7
8
|
variant?: 'tabs' | 'pills';
|
|
8
9
|
transition?: TransitionType;
|
package/esm/Tabs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["id", "onSelect", "transition", "mountOnEnter", "unmountOnExit", "children", "activeKey"];
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import requiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
5
6
|
import { useUncontrolled } from 'uncontrollable';
|
|
@@ -59,7 +60,7 @@ var Tabs = function Tabs(props) {
|
|
|
59
60
|
children = _useUncontrolled.children,
|
|
60
61
|
_useUncontrolled$acti = _useUncontrolled.activeKey,
|
|
61
62
|
activeKey = _useUncontrolled$acti === void 0 ? getDefaultActiveKey(children) : _useUncontrolled$acti,
|
|
62
|
-
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled,
|
|
63
|
+
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded);
|
|
63
64
|
|
|
64
65
|
return /*#__PURE__*/React.createElement(TabContainer, {
|
|
65
66
|
id: id,
|
package/esm/Toast.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "className", "children", "transition", "show", "animation", "delay", "autohide", "onClose"];
|
|
3
4
|
import React, { useEffect, useMemo, useRef, useCallback } from 'react';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import useTimeout from '@restart/hooks/useTimeout';
|
|
@@ -23,7 +24,7 @@ var Toast = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
23
24
|
_ref$autohide = _ref.autohide,
|
|
24
25
|
autohide = _ref$autohide === void 0 ? false : _ref$autohide,
|
|
25
26
|
onClose = _ref.onClose,
|
|
26
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
27
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
27
28
|
|
|
28
29
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'toast'); // We use refs for these, because we don't want to restart the autohide
|
|
29
30
|
// timer in case these values change.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
|
+
export declare type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'middle-start' | 'middle-center' | 'middle-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
|
|
4
|
+
export interface ToastContainerProps extends BsPrefixProps, React.HTMLAttributes<HTMLElement> {
|
|
5
|
+
position?: ToastPosition;
|
|
6
|
+
}
|
|
7
|
+
declare const ToastContainer: BsPrefixRefForwardingComponent<'div', ToastContainerProps>;
|
|
8
|
+
export default ToastContainer;
|
package/esm/ToastHeader.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "closeLabel", "closeButton", "className", "children"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React, { useContext } from 'react';
|
|
5
6
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
@@ -16,7 +17,7 @@ var ToastHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16
17
|
closeButton = _ref.closeButton,
|
|
17
18
|
className = _ref.className,
|
|
18
19
|
children = _ref.children,
|
|
19
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
20
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
21
|
|
|
21
22
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'toast-header');
|
|
22
23
|
var context = useContext(ToastContext);
|
package/esm/ToggleButton.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["children", "name", "className", "checked", "type", "onChange", "value", "disabled", "inputRef"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React, { useCallback, useState } from 'react';
|
|
5
6
|
import Button from './Button';
|
|
@@ -18,7 +19,7 @@ var ToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
18
19
|
value = _ref.value,
|
|
19
20
|
disabled = _ref.disabled,
|
|
20
21
|
inputRef = _ref.inputRef,
|
|
21
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
22
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
23
|
|
|
23
24
|
var _useState = useState(false),
|
|
24
25
|
focused = _useState[0],
|
package/esm/ToggleButtonGroup.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["children", "type", "name", "value", "onChange"];
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import invariant from 'invariant';
|
|
5
6
|
import { useUncontrolled } from 'uncontrollable';
|
|
@@ -20,7 +21,7 @@ var ToggleButtonGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
20
21
|
name = _useUncontrolled.name,
|
|
21
22
|
value = _useUncontrolled.value,
|
|
22
23
|
onChange = _useUncontrolled.onChange,
|
|
23
|
-
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled,
|
|
24
|
+
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded);
|
|
24
25
|
|
|
25
26
|
var getValues = function getValues() {
|
|
26
27
|
return value == null ? [] : [].concat(value);
|
package/esm/Tooltip.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["bsPrefix", "placement", "className", "style", "children", "arrowProps", "popper", "show"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
@@ -16,7 +17,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16
17
|
arrowProps = _ref.arrowProps,
|
|
17
18
|
_ = _ref.popper,
|
|
18
19
|
_2 = _ref.show,
|
|
19
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
20
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
21
|
|
|
21
22
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'tooltip');
|
|
22
23
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Transition, { TransitionProps, TransitionStatus } from 'react-transition-group/Transition';
|
|
3
|
+
export declare type TransitionWrapperProps = TransitionProps & {
|
|
4
|
+
childRef?: React.Ref<unknown>;
|
|
5
|
+
children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
|
|
6
|
+
};
|
|
7
|
+
declare const TransitionWrapper: React.ForwardRefExoticComponent<Pick<TransitionWrapperProps, string | number> & React.RefAttributes<Transition<any>>>;
|
|
8
|
+
export default TransitionWrapper;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["className", "bsPrefix", "as"];
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import camelize from 'dom-helpers/camelize';
|
|
5
6
|
import React from 'react';
|
|
@@ -22,7 +23,7 @@ export default function createWithBsPrefix(prefix, _temp) {
|
|
|
22
23
|
bsPrefix = _ref2.bsPrefix,
|
|
23
24
|
_ref2$as = _ref2.as,
|
|
24
25
|
Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,
|
|
25
|
-
props = _objectWithoutPropertiesLoose(_ref2,
|
|
26
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
26
27
|
|
|
27
28
|
var resolvedPrefix = useBootstrapPrefix(bsPrefix, prefix);
|
|
28
29
|
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const _default: (className: string) => React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
2
|
+
declare const _default: (className: string) => React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
|
3
3
|
export default _default;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import css from 'dom-helpers/css';
|
|
1
2
|
import transitionEnd from 'dom-helpers/transitionEnd';
|
|
3
|
+
|
|
4
|
+
function parseDuration(node, property) {
|
|
5
|
+
var str = css(node, property) || '';
|
|
6
|
+
var mult = str.indexOf('ms') === -1 ? 1000 : 1;
|
|
7
|
+
return parseFloat(str) * mult;
|
|
8
|
+
}
|
|
9
|
+
|
|
2
10
|
export default function transitionEndListener(element, handler) {
|
|
11
|
+
var duration = parseDuration(element, 'transitionDuration');
|
|
12
|
+
var delay = parseDuration(element, 'transitionDelay');
|
|
3
13
|
var remove = transitionEnd(element, function (e) {
|
|
4
14
|
if (e.target === element) {
|
|
5
15
|
remove();
|
|
6
16
|
handler(e);
|
|
7
17
|
}
|
|
8
|
-
});
|
|
18
|
+
}, duration + delay);
|
|
9
19
|
}
|
package/esm/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare type Variant = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
|
|
2
2
|
export declare type ButtonVariant = Variant | 'link' | 'outline-primary' | 'outline-secondary' | 'outline-success' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-dark' | 'outline-light';
|
|
3
3
|
export declare type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted';
|
|
4
|
+
export declare type EventKey = string | number;
|
package/esm/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,6 +19,7 @@ function getMargins(element) {
|
|
|
19
19
|
export default function usePopperMarginModifiers() {
|
|
20
20
|
var overlayRef = useRef(null);
|
|
21
21
|
var margins = useRef(null);
|
|
22
|
+
var arrowMargins = useRef(null);
|
|
22
23
|
var popoverClass = useBootstrapPrefix(undefined, 'popover');
|
|
23
24
|
var dropdownMenuClass = useBootstrapPrefix(undefined, 'dropdown-menu');
|
|
24
25
|
var callback = useCallback(function (overlay) {
|
|
@@ -59,7 +60,32 @@ export default function usePopperMarginModifiers() {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
|
-
}, [margins]);
|
|
63
|
+
}, [margins]);
|
|
64
|
+
var arrow = useMemo(function () {
|
|
65
|
+
return {
|
|
66
|
+
name: 'arrow',
|
|
67
|
+
options: {
|
|
68
|
+
padding: function padding() {
|
|
69
|
+
// The options here are used for Popper 2.8.4 and up.
|
|
70
|
+
// For earlier version, padding is handled in popoverArrowMargins below.
|
|
71
|
+
if (!arrowMargins.current) {
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var _arrowMargins$current = arrowMargins.current,
|
|
76
|
+
top = _arrowMargins$current.top,
|
|
77
|
+
right = _arrowMargins$current.right;
|
|
78
|
+
var padding = top || right;
|
|
79
|
+
return {
|
|
80
|
+
top: padding,
|
|
81
|
+
left: padding,
|
|
82
|
+
right: padding,
|
|
83
|
+
bottom: padding
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}, [arrowMargins]); // Converts popover arrow margin to arrow modifier padding
|
|
63
89
|
|
|
64
90
|
var popoverArrowMargins = useMemo(function () {
|
|
65
91
|
return {
|
|
@@ -70,21 +96,30 @@ export default function usePopperMarginModifiers() {
|
|
|
70
96
|
effect: function effect(_ref2) {
|
|
71
97
|
var state = _ref2.state;
|
|
72
98
|
|
|
73
|
-
if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass)
|
|
99
|
+
if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass)) {
|
|
74
100
|
return undefined;
|
|
75
101
|
}
|
|
76
102
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
103
|
+
if (state.modifiersData['arrow#persistent']) {
|
|
104
|
+
// @popperjs/core <= 2.8.3 uses arrow#persistent to pass padding to arrow modifier.
|
|
105
|
+
var _getMargins = getMargins(state.elements.arrow),
|
|
106
|
+
top = _getMargins.top,
|
|
107
|
+
right = _getMargins.right;
|
|
108
|
+
|
|
109
|
+
var padding = top || right;
|
|
110
|
+
state.modifiersData['arrow#persistent'].padding = {
|
|
111
|
+
top: padding,
|
|
112
|
+
left: padding,
|
|
113
|
+
right: padding,
|
|
114
|
+
bottom: padding
|
|
115
|
+
};
|
|
116
|
+
} else {
|
|
117
|
+
// @popperjs/core >= 2.8.4 gets the padding from the arrow modifier options,
|
|
118
|
+
// so we'll get the margins here, and let the arrow modifier above pass
|
|
119
|
+
// it to popper.
|
|
120
|
+
arrowMargins.current = getMargins(state.elements.arrow);
|
|
121
|
+
}
|
|
80
122
|
|
|
81
|
-
var padding = top || right;
|
|
82
|
-
state.modifiersData['arrow#persistent'].padding = {
|
|
83
|
-
top: padding,
|
|
84
|
-
left: padding,
|
|
85
|
-
right: padding,
|
|
86
|
-
bottom: padding
|
|
87
|
-
};
|
|
88
123
|
state.elements.arrow.style.margin = '0';
|
|
89
124
|
return function () {
|
|
90
125
|
if (state.elements.arrow) state.elements.arrow.style.margin = '';
|
|
@@ -92,5 +127,5 @@ export default function usePopperMarginModifiers() {
|
|
|
92
127
|
}
|
|
93
128
|
};
|
|
94
129
|
}, [popoverClass]);
|
|
95
|
-
return [callback, [offset, popoverArrowMargins]];
|
|
130
|
+
return [callback, [offset, arrow, popoverArrowMargins]];
|
|
96
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-bootstrap",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Bootstrap 4 components built with React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -25,11 +25,6 @@
|
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "git+https://github.com/react-bootstrap/react-bootstrap.git"
|
|
27
27
|
},
|
|
28
|
-
"husky": {
|
|
29
|
-
"hooks": {
|
|
30
|
-
"pre-commit": "lint-staged"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
28
|
"lint-staged": {
|
|
34
29
|
"*.{js,ts,tsx}": "eslint --fix"
|
|
35
30
|
},
|
|
@@ -38,23 +33,22 @@
|
|
|
38
33
|
"trailingComma": "all"
|
|
39
34
|
},
|
|
40
35
|
"dependencies": {
|
|
41
|
-
"@babel/runtime": "^7.
|
|
36
|
+
"@babel/runtime": "^7.14.0",
|
|
42
37
|
"@restart/context": "^2.1.4",
|
|
43
|
-
"@restart/hooks": "^0.3.
|
|
44
|
-
"@types/classnames": "^2.2.10",
|
|
38
|
+
"@restart/hooks": "^0.3.26",
|
|
45
39
|
"@types/invariant": "^2.2.33",
|
|
46
40
|
"@types/prop-types": "^15.7.3",
|
|
47
|
-
"@types/react": ">=16.
|
|
48
|
-
"@types/react-transition-group": "^4.4.
|
|
41
|
+
"@types/react": ">=16.14.8",
|
|
42
|
+
"@types/react-transition-group": "^4.4.1",
|
|
49
43
|
"@types/warning": "^3.0.0",
|
|
50
|
-
"classnames": "^2.
|
|
51
|
-
"dom-helpers": "^5.1
|
|
44
|
+
"classnames": "^2.3.1",
|
|
45
|
+
"dom-helpers": "^5.2.1",
|
|
52
46
|
"invariant": "^2.2.4",
|
|
53
47
|
"prop-types": "^15.7.2",
|
|
54
48
|
"prop-types-extra": "^1.1.0",
|
|
55
|
-
"react-overlays": "^
|
|
49
|
+
"react-overlays": "^5.0.1",
|
|
56
50
|
"react-transition-group": "^4.4.1",
|
|
57
|
-
"uncontrollable": "^7.
|
|
51
|
+
"uncontrollable": "^7.2.1",
|
|
58
52
|
"warning": "^4.0.3"
|
|
59
53
|
},
|
|
60
54
|
"peerDependencies": {
|