react-bootstrap 1.0.0-beta.13 → 1.0.0-beta.17
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/AccordionToggle.d.ts +4 -5
- package/BootstrapModalManager/package.json +6 -0
- package/Container.d.ts +1 -1
- package/ElementChildren/package.json +6 -0
- package/FormControl.d.ts +7 -2
- package/ListGroup.d.ts +1 -0
- package/Modal.d.ts +1 -0
- package/Overlay.d.ts +1 -1
- package/OverlayTrigger.d.ts +1 -0
- package/ToggleButton.d.ts +0 -1
- package/cjs/AbstractNav.js +1 -1
- package/cjs/Alert.js +4 -4
- package/cjs/{utils/BootstrapModalManager.js → BootstrapModalManager.js} +9 -5
- package/cjs/Card.js +2 -2
- package/cjs/CardColumns.js +1 -1
- package/cjs/CardDeck.js +1 -1
- package/cjs/CardGroup.js +1 -1
- package/cjs/Carousel.js +9 -9
- package/cjs/CarouselCaption.js +1 -1
- package/cjs/CarouselItem.js +1 -1
- package/cjs/Collapse.js +7 -7
- package/cjs/Container.js +3 -3
- package/cjs/Dropdown.js +5 -5
- package/cjs/DropdownMenu.js +39 -46
- package/cjs/DropdownToggle.js +31 -58
- package/cjs/{utils/ElementChildren.js → ElementChildren.js} +0 -0
- package/cjs/Fade.js +4 -4
- package/cjs/Figure.js +1 -1
- package/cjs/FigureCaption.js +1 -1
- package/cjs/Form.js +1 -1
- package/cjs/FormLabel.js +3 -1
- package/cjs/InputGroup.js +1 -1
- package/cjs/ListGroup.js +16 -3
- package/cjs/Media.js +1 -1
- package/cjs/Modal.js +32 -18
- package/cjs/ModalBody.js +1 -1
- package/cjs/ModalDialog.js +1 -1
- package/cjs/ModalFooter.js +1 -1
- package/cjs/ModalTitle.js +2 -2
- package/cjs/NavDropdown.js +64 -41
- package/cjs/Navbar.js +1 -1
- package/cjs/OverlayTrigger.js +131 -182
- package/cjs/PageItem.js +7 -4
- package/cjs/Pagination.js +21 -36
- package/cjs/Popover.js +9 -10
- package/cjs/ProgressBar.js +1 -1
- package/cjs/ResponsiveEmbed.js +19 -35
- package/cjs/Row.js +1 -0
- package/cjs/SafeAnchor.js +1 -1
- package/cjs/SplitButton.js +9 -3
- package/cjs/TabContent.js +15 -31
- package/cjs/Table.js +31 -47
- package/cjs/Tabs.js +1 -1
- package/cjs/ToastBody.js +1 -1
- package/cjs/ToggleButton.js +45 -78
- package/cjs/ToggleButtonGroup.js +44 -65
- package/cjs/Tooltip.js +2 -1
- package/cjs/{utils/createChainedFunction.js → createChainedFunction.js} +0 -0
- package/cjs/{utils/createWithBsPrefix.js → createWithBsPrefix.js} +3 -3
- package/cjs/{utils/divWithClassName.js → divWithClassName.js} +0 -0
- package/cjs/index.js +4 -0
- package/cjs/{utils/triggerBrowserReflow.js → triggerBrowserReflow.js} +0 -0
- package/cjs/useWrappedRefWithWarning.js +24 -0
- package/createChainedFunction/package.json +6 -0
- package/createWithBsPrefix/package.json +6 -0
- package/dist/react-bootstrap.js +9477 -11933
- package/dist/react-bootstrap.min.js +4 -12
- package/divWithClassName/package.json +6 -0
- package/esm/AbstractNav.js +1 -1
- package/esm/AccordionToggle.d.ts +4 -5
- package/esm/Alert.js +4 -4
- package/esm/{utils/BootstrapModalManager.js → BootstrapModalManager.js} +9 -5
- package/esm/Card.js +2 -2
- package/esm/CardColumns.js +1 -1
- package/esm/CardDeck.js +1 -1
- package/esm/CardGroup.js +1 -1
- package/esm/Carousel.js +6 -6
- package/esm/CarouselCaption.js +1 -1
- package/esm/CarouselItem.js +1 -1
- package/esm/Collapse.js +6 -6
- package/esm/Container.d.ts +1 -1
- package/esm/Container.js +3 -3
- package/esm/Dropdown.js +4 -4
- package/esm/DropdownMenu.js +34 -43
- package/esm/DropdownToggle.js +30 -56
- package/esm/{utils/ElementChildren.js → ElementChildren.js} +0 -0
- package/esm/Fade.js +3 -3
- package/esm/Figure.js +1 -1
- package/esm/FigureCaption.js +1 -1
- package/esm/Form.js +1 -1
- package/esm/FormControl.d.ts +7 -2
- package/esm/FormLabel.js +3 -1
- package/esm/InputGroup.js +1 -1
- package/esm/ListGroup.d.ts +1 -0
- package/esm/ListGroup.js +15 -3
- package/esm/Media.js +1 -1
- package/esm/Modal.d.ts +1 -0
- package/esm/Modal.js +28 -15
- package/esm/ModalBody.js +1 -1
- package/esm/ModalDialog.js +1 -1
- package/esm/ModalFooter.js +1 -1
- package/esm/ModalTitle.js +2 -2
- package/esm/NavDropdown.js +61 -41
- package/esm/Navbar.js +1 -1
- package/esm/Overlay.d.ts +1 -1
- package/esm/OverlayTrigger.d.ts +1 -0
- package/esm/OverlayTrigger.js +130 -182
- package/esm/PageItem.js +5 -2
- package/esm/Pagination.js +22 -37
- package/esm/Popover.js +10 -13
- package/esm/ProgressBar.js +1 -1
- package/esm/ResponsiveEmbed.js +18 -33
- package/esm/Row.js +1 -0
- package/esm/SafeAnchor.js +1 -1
- package/esm/SplitButton.js +9 -3
- package/esm/TabContent.js +15 -31
- package/esm/Table.js +32 -48
- package/esm/Tabs.js +1 -1
- package/esm/ToastBody.js +1 -1
- package/esm/ToggleButton.d.ts +0 -1
- package/esm/ToggleButton.js +44 -79
- package/esm/ToggleButtonGroup.js +42 -65
- package/esm/Tooltip.js +2 -1
- package/esm/{utils/createChainedFunction.js → createChainedFunction.js} +0 -0
- package/esm/{utils/createWithBsPrefix.js → createWithBsPrefix.js} +2 -2
- package/esm/{utils/divWithClassName.js → divWithClassName.js} +0 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/{utils/triggerBrowserReflow.js → triggerBrowserReflow.js} +0 -0
- package/esm/useWrappedRefWithWarning.js +12 -0
- package/index.d.ts +1 -0
- package/package.json +12 -16
- package/triggerBrowserReflow/package.json +6 -0
- package/useWrappedRefWithWarning/package.json +6 -0
package/esm/AbstractNav.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import qsa from 'dom-helpers/
|
|
3
|
+
import qsa from 'dom-helpers/querySelectorAll';
|
|
4
4
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
5
5
|
import useForceUpdate from '@restart/hooks/useForceUpdate';
|
|
6
6
|
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
package/esm/AccordionToggle.d.ts
CHANGED
|
@@ -7,11 +7,10 @@ export interface AccordionToggleProps {
|
|
|
7
7
|
onClick?: (event?: React.SyntheticEvent) => void;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
10
|
+
export function useAccordionToggle(
|
|
11
|
+
eventKey: string,
|
|
12
|
+
onClick: (event?: React.SyntheticEvent) => void,
|
|
13
|
+
): (event?: React.SyntheticEvent) => void;
|
|
15
14
|
|
|
16
15
|
declare class AccordionToggle<
|
|
17
16
|
As extends React.ElementType = 'button'
|
package/esm/Alert.js
CHANGED
|
@@ -4,8 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useUncontrolled } from 'uncontrollable';
|
|
6
6
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
7
|
-
import createWithBsPrefix from './
|
|
8
|
-
import divWithClassName from './
|
|
7
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
8
|
+
import divWithClassName from './divWithClassName';
|
|
9
9
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
10
10
|
import Fade from './Fade';
|
|
11
11
|
import CloseButton from './CloseButton';
|
|
@@ -38,6 +38,7 @@ var Alert = React.forwardRef(function (uncontrolledProps, ref) {
|
|
|
38
38
|
var alert = React.createElement("div", _extends({
|
|
39
39
|
role: "alert"
|
|
40
40
|
}, Transition ? props : undefined, {
|
|
41
|
+
ref: ref,
|
|
41
42
|
className: classNames(className, prefix, variant && prefix + "-" + variant, dismissible && prefix + "-dismissible")
|
|
42
43
|
}), dismissible && React.createElement(CloseButton, {
|
|
43
44
|
onClick: handleClose,
|
|
@@ -45,8 +46,7 @@ var Alert = React.forwardRef(function (uncontrolledProps, ref) {
|
|
|
45
46
|
}), children);
|
|
46
47
|
if (!Transition) return show ? alert : null;
|
|
47
48
|
return React.createElement(Transition, _extends({
|
|
48
|
-
unmountOnExit: true
|
|
49
|
-
ref: ref
|
|
49
|
+
unmountOnExit: true
|
|
50
50
|
}, props, {
|
|
51
51
|
in: show
|
|
52
52
|
}), alert);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import getScrollbarSize from 'dom-helpers/
|
|
2
|
+
import css from 'dom-helpers/css';
|
|
3
|
+
import qsa from 'dom-helpers/querySelectorAll';
|
|
4
|
+
import getScrollbarSize from 'dom-helpers/scrollbarSize';
|
|
5
5
|
import ModalManager from 'react-overlays/ModalManager';
|
|
6
6
|
var Selector = {
|
|
7
7
|
FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
|
|
@@ -24,17 +24,21 @@ function (_ModalManager) {
|
|
|
24
24
|
_this = _ModalManager.call.apply(_ModalManager, [this].concat(args)) || this;
|
|
25
25
|
|
|
26
26
|
_this.adjustAndStore = function (prop, element, adjust) {
|
|
27
|
+
var _css;
|
|
28
|
+
|
|
27
29
|
var actual = element.style[prop];
|
|
28
30
|
element.dataset[prop] = actual;
|
|
29
|
-
css(element,
|
|
31
|
+
css(element, (_css = {}, _css[prop] = parseFloat(css(element, prop)) + adjust + "px", _css));
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
_this.restore = function (prop, element) {
|
|
33
35
|
var value = element.dataset[prop];
|
|
34
36
|
|
|
35
37
|
if (value !== undefined) {
|
|
38
|
+
var _css2;
|
|
39
|
+
|
|
36
40
|
delete element.dataset[prop];
|
|
37
|
-
css(element, prop,
|
|
41
|
+
css(element, (_css2 = {}, _css2[prop] = value, _css2));
|
|
38
42
|
}
|
|
39
43
|
};
|
|
40
44
|
|
package/esm/Card.js
CHANGED
|
@@ -3,8 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
6
|
-
import createWithBsPrefix from './
|
|
7
|
-
import divWithClassName from './
|
|
6
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
7
|
+
import divWithClassName from './divWithClassName';
|
|
8
8
|
import CardContext from './CardContext';
|
|
9
9
|
import CardImg from './CardImg';
|
|
10
10
|
var DivStyledAsH5 = divWithClassName('h5');
|
package/esm/CardColumns.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import createWithBsPrefix from './
|
|
1
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
2
2
|
export default createWithBsPrefix('card-columns');
|
package/esm/CardDeck.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import createWithBsPrefix from './
|
|
1
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
2
2
|
export default createWithBsPrefix('card-deck');
|
package/esm/CardGroup.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import createWithBsPrefix from './
|
|
1
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
2
2
|
export default createWithBsPrefix('card-group');
|
package/esm/Carousel.js
CHANGED
|
@@ -2,16 +2,16 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import styles from 'dom-helpers/
|
|
6
|
-
import
|
|
5
|
+
import styles from 'dom-helpers/css';
|
|
6
|
+
import transitionEnd from 'dom-helpers/transitionEnd';
|
|
7
7
|
import React, { cloneElement } from 'react';
|
|
8
8
|
import { uncontrollable } from 'uncontrollable';
|
|
9
9
|
import CarouselCaption from './CarouselCaption';
|
|
10
10
|
import CarouselItem from './CarouselItem';
|
|
11
|
+
import { forEach, map } from './ElementChildren';
|
|
11
12
|
import SafeAnchor from './SafeAnchor';
|
|
12
|
-
import { map, forEach } from './utils/ElementChildren';
|
|
13
|
-
import triggerBrowserReflow from './utils/triggerBrowserReflow';
|
|
14
13
|
import { createBootstrapComponent } from './ThemeProvider';
|
|
14
|
+
import triggerBrowserReflow from './triggerBrowserReflow';
|
|
15
15
|
|
|
16
16
|
var countChildren = function countChildren(c) {
|
|
17
17
|
return React.Children.toArray(c).filter(React.isValidElement).length;
|
|
@@ -226,7 +226,7 @@ function (_React$Component) {
|
|
|
226
226
|
prevClasses: classNames('active', directionalClassName),
|
|
227
227
|
currentClasses: classNames(orderClassName, directionalClassName)
|
|
228
228
|
}, function () {
|
|
229
|
-
return
|
|
229
|
+
return transitionEnd(nextElement, function () {
|
|
230
230
|
_this2.safeSetState({
|
|
231
231
|
prevClasses: '',
|
|
232
232
|
currentClasses: 'active'
|
|
@@ -395,7 +395,7 @@ function (_React$Component) {
|
|
|
395
395
|
var current = index === activeIndex;
|
|
396
396
|
var previous = index === previousActiveIndex;
|
|
397
397
|
return cloneElement(child, {
|
|
398
|
-
className: classNames(child.props.className,
|
|
398
|
+
className: classNames(child.props.className, current && currentClasses, previous && prevClasses)
|
|
399
399
|
});
|
|
400
400
|
})), controls && this.renderControls({
|
|
401
401
|
wrap: wrap,
|
package/esm/CarouselCaption.js
CHANGED
package/esm/CarouselItem.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import createWithBsPrefix from './
|
|
1
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
2
2
|
export default createWithBsPrefix('carousel-item');
|
package/esm/Collapse.js
CHANGED
|
@@ -5,12 +5,12 @@ import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
|
5
5
|
var _collapseStyles;
|
|
6
6
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import css from 'dom-helpers/
|
|
8
|
+
import css from 'dom-helpers/css';
|
|
9
|
+
import transitionEnd from 'dom-helpers/transitionEnd';
|
|
9
10
|
import React from 'react';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import triggerBrowserReflow from './
|
|
13
|
-
import createChainedFunction from './utils/createChainedFunction';
|
|
11
|
+
import Transition, { ENTERED, ENTERING, EXITED, EXITING } from 'react-transition-group/Transition';
|
|
12
|
+
import createChainedFunction from './createChainedFunction';
|
|
13
|
+
import triggerBrowserReflow from './triggerBrowserReflow';
|
|
14
14
|
var MARGINS = {
|
|
15
15
|
height: ['marginTop', 'marginBottom'],
|
|
16
16
|
width: ['marginLeft', 'marginRight']
|
|
@@ -111,7 +111,7 @@ function (_React$Component) {
|
|
|
111
111
|
var handleExit = createChainedFunction(this.handleExit, onExit);
|
|
112
112
|
var handleExiting = createChainedFunction(this.handleExiting, onExiting);
|
|
113
113
|
return React.createElement(Transition, _extends({
|
|
114
|
-
addEndListener:
|
|
114
|
+
addEndListener: transitionEnd
|
|
115
115
|
}, props, {
|
|
116
116
|
"aria-expanded": props.role ? props.in : null,
|
|
117
117
|
onEnter: handleEnter,
|
package/esm/Container.d.ts
CHANGED
package/esm/Container.js
CHANGED
|
@@ -6,8 +6,7 @@ import { useBootstrapPrefix } from './ThemeProvider';
|
|
|
6
6
|
var defaultProps = {
|
|
7
7
|
fluid: false
|
|
8
8
|
};
|
|
9
|
-
var Container = React.forwardRef(
|
|
10
|
-
function (_ref, ref) {
|
|
9
|
+
var Container = React.forwardRef(function (_ref, ref) {
|
|
11
10
|
var bsPrefix = _ref.bsPrefix,
|
|
12
11
|
fluid = _ref.fluid,
|
|
13
12
|
_ref$as = _ref.as,
|
|
@@ -16,10 +15,11 @@ function (_ref, ref) {
|
|
|
16
15
|
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "fluid", "as", "className"]);
|
|
17
16
|
|
|
18
17
|
var prefix = useBootstrapPrefix(bsPrefix, 'container');
|
|
18
|
+
var suffix = typeof fluid === 'string' ? "-" + fluid : '-fluid';
|
|
19
19
|
return React.createElement(Component, _extends({
|
|
20
20
|
ref: ref
|
|
21
21
|
}, props, {
|
|
22
|
-
className: classNames(className, fluid ? prefix +
|
|
22
|
+
className: classNames(className, fluid ? "" + prefix + suffix : prefix)
|
|
23
23
|
}));
|
|
24
24
|
});
|
|
25
25
|
Container.displayName = 'Container';
|
package/esm/Dropdown.js
CHANGED
|
@@ -5,12 +5,12 @@ import React, { useContext } from 'react';
|
|
|
5
5
|
import BaseDropdown from 'react-overlays/Dropdown';
|
|
6
6
|
import { useUncontrolled } from 'uncontrollable';
|
|
7
7
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
8
|
-
import
|
|
8
|
+
import DropdownItem from './DropdownItem';
|
|
9
9
|
import DropdownMenu from './DropdownMenu';
|
|
10
10
|
import DropdownToggle from './DropdownToggle';
|
|
11
|
-
import DropdownItem from './DropdownItem';
|
|
12
11
|
import SelectableContext from './SelectableContext';
|
|
13
|
-
import
|
|
12
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
13
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
14
14
|
var defaultProps = {
|
|
15
15
|
navbar: false
|
|
16
16
|
};
|
|
@@ -50,7 +50,7 @@ var Dropdown = React.forwardRef(function (uncontrolledProps, ref) {
|
|
|
50
50
|
});
|
|
51
51
|
return React.createElement(SelectableContext.Provider, {
|
|
52
52
|
value: handleSelect
|
|
53
|
-
}, React.createElement(BaseDropdown
|
|
53
|
+
}, React.createElement(BaseDropdown, {
|
|
54
54
|
drop: drop,
|
|
55
55
|
show: show,
|
|
56
56
|
alignEnd: alignRight,
|
package/esm/DropdownMenu.js
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { findDOMNode } from 'react-dom';
|
|
5
4
|
import React, { useContext } from 'react';
|
|
6
|
-
import
|
|
5
|
+
import { useDropdownMenu } from 'react-overlays/DropdownMenu';
|
|
6
|
+
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
7
7
|
import NavbarContext from './NavbarContext';
|
|
8
8
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
9
|
-
|
|
10
|
-
var wrapRef = function wrapRef(props) {
|
|
11
|
-
var ref = props.ref;
|
|
12
|
-
|
|
13
|
-
props.ref = ref.__wrapped || (ref.__wrapped = function (r) {
|
|
14
|
-
return ref(findDOMNode(r));
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return props;
|
|
18
|
-
};
|
|
19
|
-
|
|
9
|
+
import useWrappedRefWithWarning from './useWrappedRefWithWarning';
|
|
20
10
|
var defaultProps = {
|
|
21
11
|
alignRight: false,
|
|
22
12
|
flip: true
|
|
@@ -35,43 +25,44 @@ var DropdownMenu = React.forwardRef(function (_ref, ref) {
|
|
|
35
25
|
|
|
36
26
|
var isNavbar = useContext(NavbarContext);
|
|
37
27
|
var prefix = useBootstrapPrefix(bsPrefix, 'dropdown-menu');
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
,
|
|
28
|
+
|
|
29
|
+
var _useDropdownMenu = useDropdownMenu({
|
|
41
30
|
flip: flip,
|
|
31
|
+
popperConfig: popperConfig,
|
|
32
|
+
rootCloseEvent: rootCloseEvent,
|
|
42
33
|
show: showProps,
|
|
43
34
|
alignEnd: alignRight,
|
|
44
|
-
usePopper: !isNavbar
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
35
|
+
usePopper: !isNavbar
|
|
36
|
+
}),
|
|
37
|
+
hasShown = _useDropdownMenu.hasShown,
|
|
38
|
+
placement = _useDropdownMenu.placement,
|
|
39
|
+
show = _useDropdownMenu.show,
|
|
40
|
+
alignEnd = _useDropdownMenu.alignEnd,
|
|
41
|
+
close = _useDropdownMenu.close,
|
|
42
|
+
menuProps = _useDropdownMenu.props;
|
|
43
|
+
|
|
44
|
+
menuProps.ref = useMergedRefs(menuProps.ref, useWrappedRefWithWarning(ref, 'DropdownMenu'));
|
|
45
|
+
if (!hasShown) return null; // For custom components provide additional, non-DOM, props;
|
|
54
46
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
if (typeof Component !== 'string') {
|
|
48
|
+
menuProps.show = show;
|
|
49
|
+
menuProps.close = close;
|
|
50
|
+
menuProps.alignRight = alignEnd;
|
|
51
|
+
}
|
|
60
52
|
|
|
61
|
-
|
|
53
|
+
var style = props.style;
|
|
62
54
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
if (placement) {
|
|
56
|
+
// we don't need the default popper style,
|
|
57
|
+
// menus are display: none when not shown.
|
|
58
|
+
style = _extends({}, style, {}, menuProps.style);
|
|
59
|
+
props['x-placement'] = placement;
|
|
60
|
+
}
|
|
69
61
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
62
|
+
return React.createElement(Component, _extends({}, props, menuProps, {
|
|
63
|
+
style: style,
|
|
64
|
+
className: classNames(className, prefix, show && 'show', alignEnd && prefix + "-right")
|
|
65
|
+
}));
|
|
75
66
|
});
|
|
76
67
|
DropdownMenu.displayName = 'DropdownMenu';
|
|
77
68
|
DropdownMenu.defaultProps = defaultProps;
|
package/esm/DropdownToggle.js
CHANGED
|
@@ -1,66 +1,40 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
|
|
4
3
|
import classNames from 'classnames';
|
|
5
|
-
import { findDOMNode } from 'react-dom';
|
|
6
4
|
import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
7
|
-
import BaseDropdownToggle from 'react-overlays/DropdownToggle';
|
|
8
5
|
import React from 'react';
|
|
6
|
+
import { useDropdownToggle } from 'react-overlays/DropdownToggle';
|
|
7
|
+
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
9
8
|
import Button from './Button';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
function DropdownToggle() {
|
|
28
|
-
return _React$Component.apply(this, arguments) || this;
|
|
9
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
10
|
+
import useWrappedRefWithWarning from './useWrappedRefWithWarning';
|
|
11
|
+
var DropdownToggle = React.forwardRef(function (_ref, ref) {
|
|
12
|
+
var bsPrefix = _ref.bsPrefix,
|
|
13
|
+
split = _ref.split,
|
|
14
|
+
className = _ref.className,
|
|
15
|
+
children = _ref.children,
|
|
16
|
+
childBsPrefix = _ref.childBsPrefix,
|
|
17
|
+
_ref$as = _ref.as,
|
|
18
|
+
Component = _ref$as === void 0 ? Button : _ref$as,
|
|
19
|
+
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "split", "className", "children", "childBsPrefix", "as"]);
|
|
20
|
+
|
|
21
|
+
var prefix = useBootstrapPrefix(bsPrefix, 'dropdown-toggle');
|
|
22
|
+
|
|
23
|
+
if (childBsPrefix !== undefined) {
|
|
24
|
+
props.bsPrefix = childBsPrefix;
|
|
29
25
|
}
|
|
30
26
|
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _this$props = this.props,
|
|
35
|
-
bsPrefix = _this$props.bsPrefix,
|
|
36
|
-
split = _this$props.split,
|
|
37
|
-
className = _this$props.className,
|
|
38
|
-
children = _this$props.children,
|
|
39
|
-
childBsPrefix = _this$props.childBsPrefix,
|
|
40
|
-
Component = _this$props.as,
|
|
41
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["bsPrefix", "split", "className", "children", "childBsPrefix", "as"]);
|
|
42
|
-
|
|
43
|
-
if (childBsPrefix !== undefined) {
|
|
44
|
-
props.bsPrefix = childBsPrefix;
|
|
45
|
-
} // This intentionally forwards size and variant (if set) to the
|
|
46
|
-
// underlying component, to allow it to render size and style variants.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return React.createElement(BaseDropdownToggle, null, function (_ref) {
|
|
50
|
-
var toggle = _ref.toggle,
|
|
51
|
-
toggleProps = _ref.props;
|
|
52
|
-
return React.createElement(Component, _extends({
|
|
53
|
-
onClick: toggle,
|
|
54
|
-
className: classNames(className, bsPrefix, split && bsPrefix + "-split")
|
|
55
|
-
}, wrapRef(toggleProps), props), children);
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return DropdownToggle;
|
|
60
|
-
}(React.Component); // Needs to be a class FTM, because it needs to accept a ref that can be used with findDOMNode
|
|
27
|
+
var _useDropdownToggle = useDropdownToggle(),
|
|
28
|
+
toggleProps = _useDropdownToggle[0],
|
|
29
|
+
toggle = _useDropdownToggle[1].toggle;
|
|
61
30
|
|
|
31
|
+
toggleProps.ref = useMergedRefs(toggleProps.ref, useWrappedRefWithWarning(ref, 'DropdownToggle')); // This intentionally forwards size and variant (if set) to the
|
|
32
|
+
// underlying component, to allow it to render size and style variants.
|
|
62
33
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
34
|
+
return React.createElement(Component, _extends({
|
|
35
|
+
onClick: toggle,
|
|
36
|
+
className: classNames(className, prefix, split && prefix + "-split")
|
|
37
|
+
}, toggleProps, props), children);
|
|
38
|
+
});
|
|
39
|
+
DropdownToggle.displayName = 'DropdownToggle';
|
|
40
|
+
export default DropdownToggle;
|
|
File without changes
|
package/esm/Fade.js
CHANGED
|
@@ -4,10 +4,10 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
var _fadeStyles;
|
|
5
5
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
+
import transitionEnd from 'dom-helpers/transitionEnd';
|
|
7
8
|
import React, { useCallback } from 'react';
|
|
8
9
|
import Transition, { ENTERED, ENTERING } from 'react-transition-group/Transition';
|
|
9
|
-
import
|
|
10
|
-
import triggerBrowserReflow from './utils/triggerBrowserReflow';
|
|
10
|
+
import triggerBrowserReflow from './triggerBrowserReflow';
|
|
11
11
|
var defaultProps = {
|
|
12
12
|
in: false,
|
|
13
13
|
timeout: 300,
|
|
@@ -27,7 +27,7 @@ var Fade = React.forwardRef(function (_ref, ref) {
|
|
|
27
27
|
}, [props]);
|
|
28
28
|
return React.createElement(Transition, _extends({
|
|
29
29
|
ref: ref,
|
|
30
|
-
addEndListener:
|
|
30
|
+
addEndListener: transitionEnd
|
|
31
31
|
}, props, {
|
|
32
32
|
onEnter: handleEnter
|
|
33
33
|
}), function (status, innerProps) {
|
package/esm/Figure.js
CHANGED
package/esm/FigureCaption.js
CHANGED
package/esm/Form.js
CHANGED
|
@@ -9,7 +9,7 @@ import FormLabel from './FormLabel';
|
|
|
9
9
|
import FormText from './FormText';
|
|
10
10
|
import Switch from './Switch';
|
|
11
11
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
12
|
-
import createWithBsPrefix from './
|
|
12
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
13
13
|
var defaultProps = {
|
|
14
14
|
inline: false
|
|
15
15
|
};
|
package/esm/FormControl.d.ts
CHANGED
|
@@ -2,14 +2,19 @@ import * as React from 'react';
|
|
|
2
2
|
import Feedback from './Feedback';
|
|
3
3
|
import { BsPrefixComponent } from './helpers';
|
|
4
4
|
|
|
5
|
+
type FormControlElement =
|
|
6
|
+
| HTMLInputElement
|
|
7
|
+
| HTMLSelectElement
|
|
8
|
+
| HTMLTextAreaElement;
|
|
9
|
+
|
|
5
10
|
export interface FormControlProps {
|
|
6
|
-
innerRef?: React.LegacyRef<
|
|
11
|
+
innerRef?: React.LegacyRef<FormControlElement>;
|
|
7
12
|
size?: 'sm' | 'lg';
|
|
8
13
|
plaintext?: boolean;
|
|
9
14
|
readOnly?: boolean;
|
|
10
15
|
disabled?: boolean;
|
|
11
16
|
value?: string;
|
|
12
|
-
onChange?: React.FormEventHandler<
|
|
17
|
+
onChange?: React.FormEventHandler<FormControlElement>;
|
|
13
18
|
type?: string;
|
|
14
19
|
id?: string;
|
|
15
20
|
isValid?: boolean;
|
package/esm/FormLabel.js
CHANGED
|
@@ -22,7 +22,9 @@ var FormLabel = React.forwardRef(function (_ref, ref) {
|
|
|
22
22
|
controlId = _useContext.controlId;
|
|
23
23
|
|
|
24
24
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-label');
|
|
25
|
-
var
|
|
25
|
+
var columnClass = 'col-form-label';
|
|
26
|
+
if (typeof column === 'string') columnClass = columnClass + "-" + column;
|
|
27
|
+
var classes = classNames(className, bsPrefix, srOnly && 'sr-only', column && columnClass);
|
|
26
28
|
process.env.NODE_ENV !== "production" ? warning(controlId == null || !htmlFor, '`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified.') : void 0;
|
|
27
29
|
htmlFor = htmlFor || controlId;
|
|
28
30
|
if (column) return React.createElement(Col, _extends({
|
package/esm/InputGroup.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import createWithBsPrefix from './
|
|
5
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
6
6
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
7
7
|
|
|
8
8
|
/**
|
package/esm/ListGroup.d.ts
CHANGED
package/esm/ListGroup.js
CHANGED
|
@@ -2,12 +2,14 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import warning from 'warning';
|
|
5
6
|
import { useUncontrolled } from 'uncontrollable';
|
|
6
7
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
7
8
|
import AbstractNav from './AbstractNav';
|
|
8
9
|
import ListGroupItem from './ListGroupItem';
|
|
9
10
|
var defaultProps = {
|
|
10
|
-
variant: null
|
|
11
|
+
variant: null,
|
|
12
|
+
horizontal: null
|
|
11
13
|
};
|
|
12
14
|
var ListGroup = React.forwardRef(function (props, ref) {
|
|
13
15
|
var _useUncontrolled = useUncontrolled(props, {
|
|
@@ -16,16 +18,26 @@ var ListGroup = React.forwardRef(function (props, ref) {
|
|
|
16
18
|
className = _useUncontrolled.className,
|
|
17
19
|
bsPrefix = _useUncontrolled.bsPrefix,
|
|
18
20
|
variant = _useUncontrolled.variant,
|
|
21
|
+
horizontal = _useUncontrolled.horizontal,
|
|
19
22
|
_useUncontrolled$as = _useUncontrolled.as,
|
|
20
23
|
as = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
|
|
21
|
-
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, ["className", "bsPrefix", "variant", "as"]);
|
|
24
|
+
controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, ["className", "bsPrefix", "variant", "horizontal", "as"]);
|
|
22
25
|
|
|
23
26
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'list-group');
|
|
27
|
+
var horizontalVariant;
|
|
28
|
+
|
|
29
|
+
if (horizontal) {
|
|
30
|
+
horizontalVariant = horizontal === true ? 'horizontal' : "horizontal-" + horizontal;
|
|
31
|
+
} else {
|
|
32
|
+
horizontalVariant = null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
process.env.NODE_ENV !== "production" ? warning(!(horizontal && variant === 'flush'), '`variant="flush"` and `horizontal` should not be used together.') : void 0;
|
|
24
36
|
return React.createElement(AbstractNav, _extends({
|
|
25
37
|
ref: ref
|
|
26
38
|
}, controlledProps, {
|
|
27
39
|
as: as,
|
|
28
|
-
className: classNames(className, bsPrefix, variant && bsPrefix + "-" + variant)
|
|
40
|
+
className: classNames(className, bsPrefix, variant && bsPrefix + "-" + variant, horizontalVariant && bsPrefix + "-" + horizontalVariant)
|
|
29
41
|
}));
|
|
30
42
|
});
|
|
31
43
|
ListGroup.defaultProps = defaultProps;
|
package/esm/Media.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import createWithBsPrefix from './
|
|
5
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
6
6
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
7
7
|
var Media = React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
8
8
|
function (_ref, ref) {
|
package/esm/Modal.d.ts
CHANGED