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/Pagination.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
4
|
import React from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
7
6
|
import PageItem, { First, Prev, Ellipsis, Next, Last } from './PageItem';
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* @property {PageItem} Item
|
|
10
10
|
* @property {PageItem} First
|
|
@@ -13,39 +13,24 @@ import PageItem, { First, Prev, Ellipsis, Next, Last } from './PageItem';
|
|
|
13
13
|
* @property {PageItem} Next
|
|
14
14
|
* @property {PageItem} Last
|
|
15
15
|
*/
|
|
16
|
+
var Pagination = React.forwardRef(function (_ref, ref) {
|
|
17
|
+
var bsPrefix = _ref.bsPrefix,
|
|
18
|
+
className = _ref.className,
|
|
19
|
+
children = _ref.children,
|
|
20
|
+
size = _ref.size,
|
|
21
|
+
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "children", "size"]);
|
|
16
22
|
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
className = _this$props.className,
|
|
32
|
-
children = _this$props.children,
|
|
33
|
-
size = _this$props.size,
|
|
34
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["bsPrefix", "className", "children", "size"]);
|
|
35
|
-
|
|
36
|
-
return React.createElement("ul", _extends({}, props, {
|
|
37
|
-
className: classNames(className, bsPrefix, size && bsPrefix + "-" + size)
|
|
38
|
-
}), children);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return Pagination;
|
|
42
|
-
}(React.Component);
|
|
43
|
-
|
|
44
|
-
var DecoratedPagination = createBootstrapComponent(Pagination, 'pagination');
|
|
45
|
-
DecoratedPagination.First = First;
|
|
46
|
-
DecoratedPagination.Prev = Prev;
|
|
47
|
-
DecoratedPagination.Ellipsis = Ellipsis;
|
|
48
|
-
DecoratedPagination.Item = PageItem;
|
|
49
|
-
DecoratedPagination.Next = Next;
|
|
50
|
-
DecoratedPagination.Last = Last;
|
|
51
|
-
export default DecoratedPagination;
|
|
23
|
+
var decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'pagination');
|
|
24
|
+
return React.createElement("ul", _extends({
|
|
25
|
+
ref: ref
|
|
26
|
+
}, props, {
|
|
27
|
+
className: classNames(className, decoratedBsPrefix, size && decoratedBsPrefix + "-" + size)
|
|
28
|
+
}), children);
|
|
29
|
+
});
|
|
30
|
+
Pagination.First = First;
|
|
31
|
+
Pagination.Prev = Prev;
|
|
32
|
+
Pagination.Ellipsis = Ellipsis;
|
|
33
|
+
Pagination.Item = PageItem;
|
|
34
|
+
Pagination.Next = Next;
|
|
35
|
+
Pagination.Last = Last;
|
|
36
|
+
export default Pagination;
|
package/esm/Popover.js
CHANGED
|
@@ -3,16 +3,14 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import isRequiredForA11y from 'prop-types-extra/lib/isRequiredForA11y';
|
|
6
|
-
import {
|
|
6
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
7
7
|
import PopoverTitle from './PopoverTitle';
|
|
8
8
|
import PopoverContent from './PopoverContent';
|
|
9
9
|
var defaultProps = {
|
|
10
10
|
placement: 'right'
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
function Popover(_ref) {
|
|
12
|
+
var Popover = React.forwardRef(function (_ref, ref) {
|
|
14
13
|
var bsPrefix = _ref.bsPrefix,
|
|
15
|
-
innerRef = _ref.innerRef,
|
|
16
14
|
placement = _ref.placement,
|
|
17
15
|
className = _ref.className,
|
|
18
16
|
style = _ref.style,
|
|
@@ -21,21 +19,20 @@ function Popover(_ref) {
|
|
|
21
19
|
arrowProps = _ref.arrowProps,
|
|
22
20
|
_ = _ref.scheduleUpdate,
|
|
23
21
|
_1 = _ref.outOfBoundaries,
|
|
24
|
-
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "
|
|
22
|
+
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "placement", "className", "style", "children", "content", "arrowProps", "scheduleUpdate", "outOfBoundaries"]);
|
|
25
23
|
|
|
24
|
+
var decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'popover');
|
|
26
25
|
return React.createElement("div", _extends({
|
|
26
|
+
ref: ref,
|
|
27
27
|
role: "tooltip",
|
|
28
|
-
ref: innerRef,
|
|
29
28
|
style: style,
|
|
30
29
|
"x-placement": placement,
|
|
31
|
-
className: classNames(className,
|
|
30
|
+
className: classNames(className, decoratedBsPrefix, "bs-popover-" + placement)
|
|
32
31
|
}, props), React.createElement("div", _extends({
|
|
33
32
|
className: "arrow"
|
|
34
33
|
}, arrowProps)), content ? React.createElement(PopoverContent, null, children) : children);
|
|
35
|
-
}
|
|
36
|
-
|
|
34
|
+
});
|
|
37
35
|
Popover.defaultProps = defaultProps;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export default DecoratedPopover;
|
|
36
|
+
Popover.Title = PopoverTitle;
|
|
37
|
+
Popover.Content = PopoverContent;
|
|
38
|
+
export default Popover;
|
package/esm/ProgressBar.js
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import React, { cloneElement } from 'react';
|
|
5
5
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
6
|
-
import { map } from './
|
|
6
|
+
import { map } from './ElementChildren';
|
|
7
7
|
var ROUND_PRECISION = 1000;
|
|
8
8
|
/**
|
|
9
9
|
* Validate that children, if any, are instances of `<ProgressBar>`.
|
package/esm/ResponsiveEmbed.js
CHANGED
|
@@ -1,42 +1,27 @@
|
|
|
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
4
|
import React from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
7
6
|
var defaultProps = {
|
|
8
7
|
aspectRatio: '1by1'
|
|
9
8
|
};
|
|
9
|
+
var ResponsiveEmbed = React.forwardRef(function (_ref, ref) {
|
|
10
|
+
var bsPrefix = _ref.bsPrefix,
|
|
11
|
+
className = _ref.className,
|
|
12
|
+
children = _ref.children,
|
|
13
|
+
aspectRatio = _ref.aspectRatio,
|
|
14
|
+
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "children", "aspectRatio"]);
|
|
10
15
|
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_proto.render = function render() {
|
|
23
|
-
var _this$props = this.props,
|
|
24
|
-
bsPrefix = _this$props.bsPrefix,
|
|
25
|
-
className = _this$props.className,
|
|
26
|
-
children = _this$props.children,
|
|
27
|
-
aspectRatio = _this$props.aspectRatio,
|
|
28
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["bsPrefix", "className", "children", "aspectRatio"]);
|
|
29
|
-
|
|
30
|
-
var child = React.Children.only(children);
|
|
31
|
-
return React.createElement("div", _extends({}, props, {
|
|
32
|
-
className: classNames(bsPrefix, className, aspectRatio && bsPrefix + "-" + aspectRatio)
|
|
33
|
-
}), React.cloneElement(child, {
|
|
34
|
-
className: classNames(child.props.className, bsPrefix + "-item")
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return ResponsiveEmbed;
|
|
39
|
-
}(React.Component);
|
|
40
|
-
|
|
16
|
+
var decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'embed-responsive');
|
|
17
|
+
var child = React.Children.only(children);
|
|
18
|
+
return React.createElement("div", _extends({
|
|
19
|
+
ref: ref
|
|
20
|
+
}, props, {
|
|
21
|
+
className: classNames(decoratedBsPrefix, className, aspectRatio && decoratedBsPrefix + "-" + aspectRatio)
|
|
22
|
+
}), React.cloneElement(child, {
|
|
23
|
+
className: classNames(child.props.className, decoratedBsPrefix + "-item")
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
41
26
|
ResponsiveEmbed.defaultProps = defaultProps;
|
|
42
|
-
export default
|
|
27
|
+
export default ResponsiveEmbed;
|
package/esm/Row.js
CHANGED
package/esm/SafeAnchor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import createChainedFunction from './
|
|
4
|
+
import createChainedFunction from './createChainedFunction';
|
|
5
5
|
|
|
6
6
|
function isTrivialHref(href) {
|
|
7
7
|
return !href || href.trim() === '#';
|
package/esm/SplitButton.js
CHANGED
|
@@ -30,6 +30,9 @@ var propTypes = {
|
|
|
30
30
|
/** The content of the non-toggle Button. */
|
|
31
31
|
title: PropTypes.node.isRequired,
|
|
32
32
|
|
|
33
|
+
/** A `type` passed to the non-toggle Button */
|
|
34
|
+
type: PropTypes.string,
|
|
35
|
+
|
|
33
36
|
/** Disables both Buttons */
|
|
34
37
|
disabled: PropTypes.bool,
|
|
35
38
|
|
|
@@ -53,7 +56,8 @@ var propTypes = {
|
|
|
53
56
|
size: PropTypes.string
|
|
54
57
|
};
|
|
55
58
|
var defaultProps = {
|
|
56
|
-
toggleLabel: 'Toggle dropdown'
|
|
59
|
+
toggleLabel: 'Toggle dropdown',
|
|
60
|
+
type: 'button'
|
|
57
61
|
};
|
|
58
62
|
var SplitButton = React.forwardRef(function (_ref, ref) {
|
|
59
63
|
var id = _ref.id,
|
|
@@ -61,6 +65,7 @@ var SplitButton = React.forwardRef(function (_ref, ref) {
|
|
|
61
65
|
size = _ref.size,
|
|
62
66
|
variant = _ref.variant,
|
|
63
67
|
title = _ref.title,
|
|
68
|
+
type = _ref.type,
|
|
64
69
|
toggleLabel = _ref.toggleLabel,
|
|
65
70
|
children = _ref.children,
|
|
66
71
|
onClick = _ref.onClick,
|
|
@@ -68,7 +73,7 @@ var SplitButton = React.forwardRef(function (_ref, ref) {
|
|
|
68
73
|
target = _ref.target,
|
|
69
74
|
menuRole = _ref.menuRole,
|
|
70
75
|
rootCloseEvent = _ref.rootCloseEvent,
|
|
71
|
-
props = _objectWithoutPropertiesLoose(_ref, ["id", "bsPrefix", "size", "variant", "title", "toggleLabel", "children", "onClick", "href", "target", "menuRole", "rootCloseEvent"]);
|
|
76
|
+
props = _objectWithoutPropertiesLoose(_ref, ["id", "bsPrefix", "size", "variant", "title", "type", "toggleLabel", "children", "onClick", "href", "target", "menuRole", "rootCloseEvent"]);
|
|
72
77
|
|
|
73
78
|
return React.createElement(Dropdown, _extends({
|
|
74
79
|
ref: ref
|
|
@@ -81,7 +86,8 @@ var SplitButton = React.forwardRef(function (_ref, ref) {
|
|
|
81
86
|
bsPrefix: bsPrefix,
|
|
82
87
|
href: href,
|
|
83
88
|
target: target,
|
|
84
|
-
onClick: onClick
|
|
89
|
+
onClick: onClick,
|
|
90
|
+
type: type
|
|
85
91
|
}, title), React.createElement(Dropdown.Toggle, {
|
|
86
92
|
split: true,
|
|
87
93
|
id: id,
|
package/esm/TabContent.js
CHANGED
|
@@ -1,36 +1,20 @@
|
|
|
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
4
|
import React from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
6
|
+
var TabContent = React.forwardRef(function (_ref, ref) {
|
|
7
|
+
var bsPrefix = _ref.bsPrefix,
|
|
8
|
+
_ref$as = _ref.as,
|
|
9
|
+
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
10
|
+
className = _ref.className,
|
|
11
|
+
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "as", "className"]);
|
|
7
12
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _proto = TabContent.prototype;
|
|
18
|
-
|
|
19
|
-
_proto.render = function render() {
|
|
20
|
-
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
21
|
-
var _this$props = this.props,
|
|
22
|
-
bsPrefix = _this$props.bsPrefix,
|
|
23
|
-
_this$props$as = _this$props.as,
|
|
24
|
-
Component = _this$props$as === void 0 ? 'div' : _this$props$as,
|
|
25
|
-
className = _this$props.className,
|
|
26
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["bsPrefix", "as", "className"]);
|
|
27
|
-
|
|
28
|
-
return React.createElement(Component, _extends({}, props, {
|
|
29
|
-
className: classNames(className, bsPrefix)
|
|
30
|
-
}));
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
return TabContent;
|
|
34
|
-
}(React.Component);
|
|
35
|
-
|
|
36
|
-
export default createBootstrapComponent(TabContent, 'tab-content');
|
|
13
|
+
var decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'tab-content');
|
|
14
|
+
return React.createElement(Component, _extends({
|
|
15
|
+
ref: ref
|
|
16
|
+
}, props, {
|
|
17
|
+
className: classNames(className, decoratedBsPrefix)
|
|
18
|
+
}));
|
|
19
|
+
});
|
|
20
|
+
export default TabContent;
|
package/esm/Table.js
CHANGED
|
@@ -1,55 +1,39 @@
|
|
|
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
4
|
import React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var classes = classNames(bsPrefix, className, variant && bsPrefix + "-" + variant, size && bsPrefix + "-" + size, striped && bsPrefix + "-striped", bordered && bsPrefix + "-bordered", borderless && bsPrefix + "-borderless", hover && bsPrefix + "-hover");
|
|
33
|
-
var table = React.createElement("table", _extends({}, props, {
|
|
34
|
-
className: classes
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
if (responsive) {
|
|
38
|
-
var responsiveClass = bsPrefix + "-responsive";
|
|
39
|
-
|
|
40
|
-
if (typeof responsive === 'string') {
|
|
41
|
-
responsiveClass = responsiveClass + "-" + responsive;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return React.createElement("div", {
|
|
45
|
-
className: responsiveClass
|
|
46
|
-
}, table);
|
|
5
|
+
import { useBootstrapPrefix } from './ThemeProvider';
|
|
6
|
+
var Table = React.forwardRef(function (_ref, ref) {
|
|
7
|
+
var bsPrefix = _ref.bsPrefix,
|
|
8
|
+
className = _ref.className,
|
|
9
|
+
striped = _ref.striped,
|
|
10
|
+
bordered = _ref.bordered,
|
|
11
|
+
borderless = _ref.borderless,
|
|
12
|
+
hover = _ref.hover,
|
|
13
|
+
size = _ref.size,
|
|
14
|
+
variant = _ref.variant,
|
|
15
|
+
responsive = _ref.responsive,
|
|
16
|
+
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "striped", "bordered", "borderless", "hover", "size", "variant", "responsive"]);
|
|
17
|
+
|
|
18
|
+
var decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'table');
|
|
19
|
+
var classes = classNames(className, decoratedBsPrefix, variant && decoratedBsPrefix + "-" + variant, size && decoratedBsPrefix + "-" + size, striped && decoratedBsPrefix + "-striped", bordered && decoratedBsPrefix + "-bordered", borderless && decoratedBsPrefix + "-borderless", hover && decoratedBsPrefix + "-hover");
|
|
20
|
+
var table = React.createElement("table", _extends({}, props, {
|
|
21
|
+
className: classes,
|
|
22
|
+
ref: ref
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
if (responsive) {
|
|
26
|
+
var responsiveClass = decoratedBsPrefix + "-responsive";
|
|
27
|
+
|
|
28
|
+
if (typeof responsive === 'string') {
|
|
29
|
+
responsiveClass = responsiveClass + "-" + responsive;
|
|
47
30
|
}
|
|
48
31
|
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}(React.Component);
|
|
32
|
+
return React.createElement("div", {
|
|
33
|
+
className: responsiveClass
|
|
34
|
+
}, table);
|
|
35
|
+
}
|
|
54
36
|
|
|
55
|
-
|
|
37
|
+
return table;
|
|
38
|
+
});
|
|
39
|
+
export default Table;
|
package/esm/Tabs.js
CHANGED
|
@@ -9,7 +9,7 @@ import NavItem from './NavItem';
|
|
|
9
9
|
import TabContainer from './TabContainer';
|
|
10
10
|
import TabContent from './TabContent';
|
|
11
11
|
import TabPane from './TabPane';
|
|
12
|
-
import { forEach, map } from './
|
|
12
|
+
import { forEach, map } from './ElementChildren';
|
|
13
13
|
var defaultProps = {
|
|
14
14
|
variant: 'tabs',
|
|
15
15
|
mountOnEnter: false,
|
package/esm/ToastBody.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import createWithBsPrefix from './
|
|
1
|
+
import createWithBsPrefix from './createWithBsPrefix';
|
|
2
2
|
export default createWithBsPrefix('toast-body');
|
package/esm/ToggleButton.d.ts
CHANGED
package/esm/ToggleButton.js
CHANGED
|
@@ -1,86 +1,51 @@
|
|
|
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 React from 'react';
|
|
4
|
+
import React, { useState, useCallback } from 'react';
|
|
6
5
|
import Button from './Button';
|
|
7
6
|
|
|
8
7
|
var noop = function noop() {};
|
|
9
8
|
|
|
10
|
-
var ToggleButton =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
disabled = _this$props.disabled,
|
|
54
|
-
inputRef = _this$props.inputRef,
|
|
55
|
-
innerRef = _this$props.innerRef,
|
|
56
|
-
props = _objectWithoutPropertiesLoose(_this$props, ["children", "name", "className", "checked", "type", "onChange", "value", "disabled", "inputRef", "innerRef"]);
|
|
57
|
-
|
|
58
|
-
var focused = this.state.focused;
|
|
59
|
-
return React.createElement(Button, _extends({}, props, {
|
|
60
|
-
ref: innerRef,
|
|
61
|
-
className: classNames(className, focused && 'focus', disabled && 'disabled'),
|
|
62
|
-
type: null,
|
|
63
|
-
active: !!checked,
|
|
64
|
-
as: "label"
|
|
65
|
-
}), React.createElement("input", {
|
|
66
|
-
name: name,
|
|
67
|
-
type: type,
|
|
68
|
-
value: value,
|
|
69
|
-
ref: inputRef,
|
|
70
|
-
autoComplete: "off",
|
|
71
|
-
checked: !!checked,
|
|
72
|
-
disabled: !!disabled,
|
|
73
|
-
onFocus: this.handleFocus,
|
|
74
|
-
onBlur: this.handleBlur,
|
|
75
|
-
onChange: onChange || noop
|
|
76
|
-
}), children);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return ToggleButton;
|
|
80
|
-
}(React.Component);
|
|
81
|
-
|
|
82
|
-
export default React.forwardRef(function (props, ref) {
|
|
83
|
-
return React.createElement(ToggleButton, _extends({
|
|
84
|
-
innerRef: ref
|
|
85
|
-
}, props));
|
|
86
|
-
});
|
|
9
|
+
var ToggleButton = React.forwardRef(function (_ref, ref) {
|
|
10
|
+
var children = _ref.children,
|
|
11
|
+
name = _ref.name,
|
|
12
|
+
className = _ref.className,
|
|
13
|
+
checked = _ref.checked,
|
|
14
|
+
type = _ref.type,
|
|
15
|
+
onChange = _ref.onChange,
|
|
16
|
+
value = _ref.value,
|
|
17
|
+
disabled = _ref.disabled,
|
|
18
|
+
inputRef = _ref.inputRef,
|
|
19
|
+
props = _objectWithoutPropertiesLoose(_ref, ["children", "name", "className", "checked", "type", "onChange", "value", "disabled", "inputRef"]);
|
|
20
|
+
|
|
21
|
+
var _useState = useState(false),
|
|
22
|
+
focused = _useState[0],
|
|
23
|
+
setFocused = _useState[1];
|
|
24
|
+
|
|
25
|
+
var handleFocus = useCallback(function (e) {
|
|
26
|
+
if (e.target.tagName === 'INPUT') setFocused(true);
|
|
27
|
+
}, []);
|
|
28
|
+
var handleBlur = useCallback(function (e) {
|
|
29
|
+
if (e.target.tagName === 'INPUT') setFocused(false);
|
|
30
|
+
}, []);
|
|
31
|
+
return React.createElement(Button, _extends({}, props, {
|
|
32
|
+
ref: ref,
|
|
33
|
+
className: classNames(className, focused && 'focus', disabled && 'disabled'),
|
|
34
|
+
type: null,
|
|
35
|
+
active: !!checked,
|
|
36
|
+
as: "label"
|
|
37
|
+
}), React.createElement("input", {
|
|
38
|
+
name: name,
|
|
39
|
+
type: type,
|
|
40
|
+
value: value,
|
|
41
|
+
ref: inputRef,
|
|
42
|
+
autoComplete: "off",
|
|
43
|
+
checked: !!checked,
|
|
44
|
+
disabled: !!disabled,
|
|
45
|
+
onFocus: handleFocus,
|
|
46
|
+
onBlur: handleBlur,
|
|
47
|
+
onChange: onChange || noop
|
|
48
|
+
}), children);
|
|
49
|
+
});
|
|
50
|
+
ToggleButton.displayName = 'ToggleButton';
|
|
51
|
+
export default ToggleButton;
|