react-bootstrap 0.32.0 → 0.32.4
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/CHANGELOG.md +38 -0
- package/README.md +11 -7
- package/dist/react-bootstrap.js +13464 -13723
- package/dist/react-bootstrap.min.js +10 -18464
- package/es/Accordion.js +13 -16
- package/es/Alert.js +26 -31
- package/es/Badge.js +21 -31
- package/es/Breadcrumb.js +17 -20
- package/es/BreadcrumbItem.js +30 -30
- package/es/Button.js +23 -27
- package/es/ButtonGroup.js +20 -22
- package/es/ButtonToolbar.js +16 -18
- package/es/Carousel.js +120 -157
- package/es/CarouselCaption.js +18 -21
- package/es/CarouselItem.js +34 -33
- package/es/Checkbox.js +43 -54
- package/es/Clearfix.js +24 -24
- package/es/CloseButton.js +21 -30
- package/es/Col.js +42 -26
- package/es/Collapse.js +68 -68
- package/es/ControlLabel.js +19 -24
- package/es/Dropdown.js +93 -91
- package/es/DropdownButton.js +25 -35
- package/es/DropdownMenu.js +65 -65
- package/es/DropdownToggle.js +28 -40
- package/es/Fade.js +26 -29
- package/es/Form.js +22 -22
- package/es/FormControl.js +32 -33
- package/es/FormControlFeedback.js +21 -21
- package/es/FormControlStatic.js +18 -21
- package/es/FormGroup.js +27 -34
- package/es/Glyphicon.js +18 -19
- package/es/Grid.js +20 -22
- package/es/HelpBlock.js +17 -17
- package/es/Image.js +19 -24
- package/es/InputGroup.js +17 -18
- package/es/InputGroupAddon.js +17 -17
- package/es/InputGroupButton.js +17 -17
- package/es/Jumbotron.js +18 -21
- package/es/Label.js +21 -27
- package/es/ListGroup.js +24 -29
- package/es/ListGroupItem.js +30 -48
- package/es/Media.js +18 -22
- package/es/MediaBody.js +19 -22
- package/es/MediaHeading.js +18 -21
- package/es/MediaLeft.js +18 -19
- package/es/MediaList.js +17 -17
- package/es/MediaListItem.js +17 -17
- package/es/MediaRight.js +18 -19
- package/es/MenuItem.js +44 -49
- package/es/Modal.js +63 -74
- package/es/ModalBody.js +18 -21
- package/es/ModalDialog.js +31 -39
- package/es/ModalFooter.js +18 -21
- package/es/ModalHeader.js +25 -35
- package/es/ModalTitle.js +18 -21
- package/es/Nav.js +73 -92
- package/es/NavDropdown.js +40 -52
- package/es/NavItem.js +34 -38
- package/es/Navbar.js +62 -73
- package/es/NavbarBrand.js +20 -24
- package/es/NavbarCollapse.js +21 -28
- package/es/NavbarHeader.js +19 -20
- package/es/NavbarToggle.js +30 -38
- package/es/Overlay.js +21 -25
- package/es/OverlayTrigger.js +71 -68
- package/es/PageHeader.js +18 -26
- package/es/PageItem.js +0 -1
- package/es/Pager.js +23 -30
- package/es/PagerItem.js +36 -40
- package/es/Pagination.js +18 -24
- package/es/PaginationItem.js +47 -57
- package/es/Panel.js +51 -54
- package/es/PanelBody.js +18 -29
- package/es/PanelCollapse.js +20 -23
- package/es/PanelFooter.js +16 -23
- package/es/PanelGroup.js +44 -45
- package/es/PanelHeading.js +19 -28
- package/es/PanelTitle.js +22 -34
- package/es/PanelToggle.js +21 -24
- package/es/Popover.js +36 -46
- package/es/ProgressBar.js +59 -62
- package/es/Radio.js +43 -54
- package/es/ResponsiveEmbed.js +27 -32
- package/es/Row.js +18 -21
- package/es/SafeAnchor.js +32 -32
- package/es/SplitButton.js +33 -46
- package/es/SplitToggle.js +14 -13
- package/es/Tab.js +12 -18
- package/es/TabContainer.js +24 -30
- package/es/TabContent.js +36 -43
- package/es/TabPane.js +58 -68
- package/es/Table.js +25 -29
- package/es/Tabs.js +56 -71
- package/es/Thumbnail.js +34 -34
- package/es/ToggleButton.js +32 -37
- package/es/ToggleButtonGroup.js +45 -57
- package/es/Tooltip.js +33 -40
- package/es/Well.js +17 -17
- package/es/index.js +2 -0
- package/es/utils/PropTypes.js +13 -19
- package/es/utils/StyleConfig.js +0 -4
- package/es/utils/ValidComponentChildren.js +11 -20
- package/es/utils/bootstrapUtils.js +17 -31
- package/es/utils/createChainedFunction.js +2 -2
- package/es/utils/deprecationWarning.js +28 -30
- package/es/utils/splitComponentProps.js +1 -2
- package/lib/Accordion.js +23 -36
- package/lib/Alert.js +43 -65
- package/lib/Badge.js +36 -56
- package/lib/Breadcrumb.js +32 -47
- package/lib/BreadcrumbItem.js +48 -63
- package/lib/Button.js +49 -71
- package/lib/ButtonGroup.js +39 -57
- package/lib/ButtonToolbar.js +29 -42
- package/lib/Carousel.js +161 -214
- package/lib/CarouselCaption.js +32 -46
- package/lib/CarouselItem.js +54 -73
- package/lib/Checkbox.js +64 -87
- package/lib/Clearfix.js +45 -58
- package/lib/CloseButton.js +33 -50
- package/lib/Col.js +78 -73
- package/lib/Collapse.js +104 -125
- package/lib/ControlLabel.js +38 -59
- package/lib/Dropdown.js +153 -192
- package/lib/DropdownButton.js +44 -70
- package/lib/DropdownMenu.js +96 -120
- package/lib/DropdownToggle.js +48 -77
- package/lib/Fade.js +49 -68
- package/lib/Form.js +39 -52
- package/lib/FormControl.js +58 -79
- package/lib/FormControlFeedback.js +42 -54
- package/lib/FormControlStatic.js +32 -46
- package/lib/FormGroup.js +47 -67
- package/lib/Glyphicon.js +33 -46
- package/lib/Grid.js +36 -51
- package/lib/HelpBlock.js +29 -40
- package/lib/Image.js +37 -53
- package/lib/InputGroup.js +34 -49
- package/lib/InputGroupAddon.js +29 -40
- package/lib/InputGroupButton.js +29 -40
- package/lib/Jumbotron.js +32 -46
- package/lib/Label.js +35 -53
- package/lib/ListGroup.js +45 -61
- package/lib/ListGroupItem.js +55 -85
- package/lib/Media.js +43 -70
- package/lib/MediaBody.js +37 -55
- package/lib/MediaHeading.js +32 -46
- package/lib/MediaLeft.js +34 -48
- package/lib/MediaList.js +29 -40
- package/lib/MediaListItem.js +29 -40
- package/lib/MediaRight.js +34 -48
- package/lib/MenuItem.js +70 -92
- package/lib/Modal.js +130 -186
- package/lib/ModalBody.js +32 -46
- package/lib/ModalDialog.js +47 -69
- package/lib/ModalFooter.js +32 -46
- package/lib/ModalHeader.js +43 -70
- package/lib/ModalTitle.js +32 -46
- package/lib/Nav.js +122 -160
- package/lib/NavDropdown.js +63 -97
- package/lib/NavItem.js +54 -77
- package/lib/Navbar.js +115 -152
- package/lib/NavbarBrand.js +37 -55
- package/lib/NavbarCollapse.js +36 -57
- package/lib/NavbarHeader.js +33 -48
- package/lib/NavbarToggle.js +52 -77
- package/lib/Overlay.js +50 -75
- package/lib/OverlayTrigger.js +114 -129
- package/lib/PageHeader.js +30 -49
- package/lib/PageItem.js +9 -10
- package/lib/Pager.js +41 -63
- package/lib/PagerItem.js +55 -78
- package/lib/Pagination.js +32 -50
- package/lib/PaginationItem.js +67 -91
- package/lib/Panel.js +93 -127
- package/lib/PanelBody.js +35 -57
- package/lib/PanelCollapse.js +44 -56
- package/lib/PanelFooter.js +31 -48
- package/lib/PanelGroup.js +73 -88
- package/lib/PanelHeading.js +37 -59
- package/lib/PanelTitle.js +41 -68
- package/lib/PanelToggle.js +45 -66
- package/lib/Popover.js +59 -84
- package/lib/ProgressBar.js +86 -103
- package/lib/Radio.js +64 -87
- package/lib/ResponsiveEmbed.js +45 -63
- package/lib/Row.js +32 -46
- package/lib/SafeAnchor.js +53 -69
- package/lib/SplitButton.js +57 -90
- package/lib/SplitToggle.js +25 -34
- package/lib/Tab.js +32 -55
- package/lib/TabContainer.js +45 -61
- package/lib/TabContent.js +67 -87
- package/lib/TabPane.js +103 -131
- package/lib/Table.js +44 -59
- package/lib/Tabs.js +82 -119
- package/lib/Thumbnail.js +55 -67
- package/lib/ToggleButton.js +49 -68
- package/lib/ToggleButtonGroup.js +67 -104
- package/lib/Tooltip.js +55 -77
- package/lib/Well.js +30 -41
- package/lib/index.js +147 -214
- package/lib/utils/PropTypes.js +24 -31
- package/lib/utils/StyleConfig.js +13 -11
- package/lib/utils/ValidComponentChildren.js +34 -29
- package/lib/utils/bootstrapUtils.js +41 -52
- package/lib/utils/capitalize.js +2 -0
- package/lib/utils/createChainedFunction.js +8 -5
- package/lib/utils/deprecationWarning.js +37 -47
- package/lib/utils/index.js +11 -15
- package/lib/utils/splitComponentProps.js +5 -10
- package/package.json +58 -50
package/es/PagerItem.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
4
|
+
import _assertThisInitialized from "@babel/runtime-corejs2/helpers/esm/assertThisInitialized";
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
|
-
|
|
10
8
|
import SafeAnchor from './SafeAnchor';
|
|
11
9
|
import createChainedFunction from './utils/createChainedFunction';
|
|
12
|
-
|
|
13
10
|
var propTypes = {
|
|
14
11
|
disabled: PropTypes.bool,
|
|
15
12
|
previous: PropTypes.bool,
|
|
@@ -18,31 +15,32 @@ var propTypes = {
|
|
|
18
15
|
onSelect: PropTypes.func,
|
|
19
16
|
eventKey: PropTypes.any
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
var defaultProps = {
|
|
23
19
|
disabled: false,
|
|
24
20
|
previous: false,
|
|
25
21
|
next: false
|
|
26
22
|
};
|
|
27
23
|
|
|
28
|
-
var PagerItem =
|
|
29
|
-
|
|
24
|
+
var PagerItem =
|
|
25
|
+
/*#__PURE__*/
|
|
26
|
+
function (_React$Component) {
|
|
27
|
+
_inheritsLoose(PagerItem, _React$Component);
|
|
30
28
|
|
|
31
29
|
function PagerItem(props, context) {
|
|
32
|
-
|
|
30
|
+
var _this;
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_this.handleSelect = _this.handleSelect.bind(_this);
|
|
32
|
+
_this = _React$Component.call(this, props, context) || this;
|
|
33
|
+
_this.handleSelect = _this.handleSelect.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
37
34
|
return _this;
|
|
38
35
|
}
|
|
39
36
|
|
|
40
|
-
PagerItem.prototype
|
|
41
|
-
var _props = this.props,
|
|
42
|
-
disabled = _props.disabled,
|
|
43
|
-
onSelect = _props.onSelect,
|
|
44
|
-
eventKey = _props.eventKey;
|
|
37
|
+
var _proto = PagerItem.prototype;
|
|
45
38
|
|
|
39
|
+
_proto.handleSelect = function handleSelect(e) {
|
|
40
|
+
var _this$props = this.props,
|
|
41
|
+
disabled = _this$props.disabled,
|
|
42
|
+
onSelect = _this$props.onSelect,
|
|
43
|
+
eventKey = _this$props.eventKey;
|
|
46
44
|
|
|
47
45
|
if (disabled) {
|
|
48
46
|
e.preventDefault();
|
|
@@ -54,30 +52,29 @@ var PagerItem = function (_React$Component) {
|
|
|
54
52
|
}
|
|
55
53
|
};
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
disabled =
|
|
60
|
-
previous =
|
|
61
|
-
next =
|
|
62
|
-
onClick =
|
|
63
|
-
className =
|
|
64
|
-
style =
|
|
65
|
-
props =
|
|
55
|
+
_proto.render = function render() {
|
|
56
|
+
var _this$props2 = this.props,
|
|
57
|
+
disabled = _this$props2.disabled,
|
|
58
|
+
previous = _this$props2.previous,
|
|
59
|
+
next = _this$props2.next,
|
|
60
|
+
onClick = _this$props2.onClick,
|
|
61
|
+
className = _this$props2.className,
|
|
62
|
+
style = _this$props2.style,
|
|
63
|
+
props = _objectWithoutPropertiesLoose(_this$props2, ["disabled", "previous", "next", "onClick", "className", "style"]);
|
|
66
64
|
|
|
67
65
|
delete props.onSelect;
|
|
68
66
|
delete props.eventKey;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
'li',
|
|
72
|
-
{
|
|
73
|
-
className: classNames(className, { disabled: disabled, previous: previous, next: next }),
|
|
74
|
-
style: style
|
|
75
|
-
},
|
|
76
|
-
React.createElement(SafeAnchor, _extends({}, props, {
|
|
67
|
+
return React.createElement("li", {
|
|
68
|
+
className: classNames(className, {
|
|
77
69
|
disabled: disabled,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
previous: previous,
|
|
71
|
+
next: next
|
|
72
|
+
}),
|
|
73
|
+
style: style
|
|
74
|
+
}, React.createElement(SafeAnchor, _extends({}, props, {
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
onClick: createChainedFunction(onClick, this.handleSelect)
|
|
77
|
+
})));
|
|
81
78
|
};
|
|
82
79
|
|
|
83
80
|
return PagerItem;
|
|
@@ -85,5 +82,4 @@ var PagerItem = function (_React$Component) {
|
|
|
85
82
|
|
|
86
83
|
PagerItem.propTypes = propTypes;
|
|
87
84
|
PagerItem.defaultProps = defaultProps;
|
|
88
|
-
|
|
89
85
|
export default PagerItem;
|
package/es/Pagination.js
CHANGED
|
@@ -1,52 +1,46 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import React from 'react';
|
|
8
|
-
|
|
9
6
|
import PaginationItem, { First, Prev, Ellipsis, Next, Last } from './PaginationItem';
|
|
10
7
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
11
8
|
|
|
12
|
-
var Pagination =
|
|
13
|
-
|
|
9
|
+
var Pagination =
|
|
10
|
+
/*#__PURE__*/
|
|
11
|
+
function (_React$Component) {
|
|
12
|
+
_inheritsLoose(Pagination, _React$Component);
|
|
14
13
|
|
|
15
14
|
function Pagination() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
15
|
+
return _React$Component.apply(this, arguments) || this;
|
|
19
16
|
}
|
|
20
17
|
|
|
21
|
-
Pagination.prototype
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
var _proto = Pagination.prototype;
|
|
19
|
+
|
|
20
|
+
_proto.render = function render() {
|
|
21
|
+
var _this$props = this.props,
|
|
22
|
+
className = _this$props.className,
|
|
23
|
+
children = _this$props.children,
|
|
24
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["className", "children"]);
|
|
26
25
|
|
|
27
26
|
var _splitBsProps = splitBsProps(props),
|
|
28
27
|
bsProps = _splitBsProps[0],
|
|
29
28
|
elementProps = _splitBsProps[1];
|
|
30
29
|
|
|
31
30
|
var classes = getClassSet(bsProps);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
_extends({}, elementProps, { className: classNames(className, classes) }),
|
|
36
|
-
children
|
|
37
|
-
);
|
|
31
|
+
return React.createElement("ul", _extends({}, elementProps, {
|
|
32
|
+
className: classNames(className, classes)
|
|
33
|
+
}), children);
|
|
38
34
|
};
|
|
39
35
|
|
|
40
36
|
return Pagination;
|
|
41
37
|
}(React.Component);
|
|
42
38
|
|
|
43
39
|
bsClass('pagination', Pagination);
|
|
44
|
-
|
|
45
40
|
Pagination.First = First;
|
|
46
41
|
Pagination.Prev = Prev;
|
|
47
42
|
Pagination.Ellipsis = Ellipsis;
|
|
48
43
|
Pagination.Item = PaginationItem;
|
|
49
44
|
Pagination.Next = Next;
|
|
50
45
|
Pagination.Last = Last;
|
|
51
|
-
|
|
52
46
|
export default Pagination;
|
package/es/PaginationItem.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
2
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
|
|
6
5
|
/* eslint-disable react/no-multi-comp */
|
|
7
6
|
import classNames from 'classnames';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import React from 'react';
|
|
10
|
-
|
|
11
9
|
import SafeAnchor from './SafeAnchor';
|
|
12
|
-
|
|
13
10
|
var propTypes = {
|
|
14
11
|
eventKey: PropTypes.any,
|
|
15
12
|
className: PropTypes.string,
|
|
@@ -18,13 +15,11 @@ var propTypes = {
|
|
|
18
15
|
active: PropTypes.bool,
|
|
19
16
|
activeLabel: PropTypes.string.isRequired
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
var defaultProps = {
|
|
23
19
|
active: false,
|
|
24
20
|
disabled: false,
|
|
25
21
|
activeLabel: '(current)'
|
|
26
22
|
};
|
|
27
|
-
|
|
28
23
|
export default function PaginationItem(_ref) {
|
|
29
24
|
var active = _ref.active,
|
|
30
25
|
disabled = _ref.disabled,
|
|
@@ -32,71 +27,66 @@ export default function PaginationItem(_ref) {
|
|
|
32
27
|
style = _ref.style,
|
|
33
28
|
activeLabel = _ref.activeLabel,
|
|
34
29
|
children = _ref.children,
|
|
35
|
-
props =
|
|
30
|
+
props = _objectWithoutPropertiesLoose(_ref, ["active", "disabled", "className", "style", "activeLabel", "children"]);
|
|
36
31
|
|
|
37
32
|
var Component = active || disabled ? 'span' : SafeAnchor;
|
|
38
|
-
return React.createElement(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
)
|
|
51
|
-
);
|
|
33
|
+
return React.createElement("li", {
|
|
34
|
+
style: style,
|
|
35
|
+
className: classNames(className, {
|
|
36
|
+
active: active,
|
|
37
|
+
disabled: disabled
|
|
38
|
+
})
|
|
39
|
+
}, React.createElement(Component, _extends({
|
|
40
|
+
disabled: disabled
|
|
41
|
+
}, props), children, active && React.createElement("span", {
|
|
42
|
+
className: "sr-only"
|
|
43
|
+
}, activeLabel)));
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
PaginationItem.propTypes = propTypes;
|
|
55
46
|
PaginationItem.defaultProps = defaultProps;
|
|
56
47
|
|
|
57
|
-
function createButton(name, defaultValue) {
|
|
48
|
+
function createButton(name, defaultValue, label) {
|
|
58
49
|
var _class, _temp;
|
|
59
50
|
|
|
60
|
-
|
|
51
|
+
if (label === void 0) {
|
|
52
|
+
label = name;
|
|
53
|
+
}
|
|
61
54
|
|
|
62
|
-
return _temp = _class =
|
|
63
|
-
|
|
55
|
+
return _temp = _class =
|
|
56
|
+
/*#__PURE__*/
|
|
57
|
+
function (_React$Component) {
|
|
58
|
+
_inheritsLoose(_class, _React$Component);
|
|
64
59
|
|
|
65
60
|
function _class() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
61
|
+
return _React$Component.apply(this, arguments) || this;
|
|
69
62
|
}
|
|
70
63
|
|
|
71
|
-
_class.prototype
|
|
72
|
-
var _props = this.props,
|
|
73
|
-
disabled = _props.disabled,
|
|
74
|
-
children = _props.children,
|
|
75
|
-
className = _props.className,
|
|
76
|
-
props = _objectWithoutProperties(_props, ['disabled', 'children', 'className']);
|
|
64
|
+
var _proto = _class.prototype;
|
|
77
65
|
|
|
78
|
-
|
|
66
|
+
_proto.render = function render() {
|
|
67
|
+
var _this$props = this.props,
|
|
68
|
+
disabled = _this$props.disabled,
|
|
69
|
+
children = _this$props.children,
|
|
70
|
+
className = _this$props.className,
|
|
71
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["disabled", "children", "className"]);
|
|
79
72
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
Component,
|
|
88
|
-
null,
|
|
89
|
-
children || defaultValue
|
|
90
|
-
)
|
|
91
|
-
);
|
|
73
|
+
var Component = disabled ? 'span' : SafeAnchor;
|
|
74
|
+
return React.createElement("li", _extends({
|
|
75
|
+
"aria-label": label,
|
|
76
|
+
className: classNames(className, {
|
|
77
|
+
disabled: disabled
|
|
78
|
+
})
|
|
79
|
+
}, props), React.createElement(Component, null, children || defaultValue));
|
|
92
80
|
};
|
|
93
81
|
|
|
94
82
|
return _class;
|
|
95
|
-
}(React.Component), _class.displayName = name, _class.propTypes = {
|
|
83
|
+
}(React.Component), _class.displayName = name, _class.propTypes = {
|
|
84
|
+
disabled: PropTypes.bool
|
|
85
|
+
}, _temp;
|
|
96
86
|
}
|
|
97
87
|
|
|
98
|
-
export var First = createButton('First',
|
|
99
|
-
export var Prev = createButton('Prev',
|
|
100
|
-
export var Ellipsis = createButton('Ellipsis',
|
|
101
|
-
export var Next = createButton('Next',
|
|
102
|
-
export var Last = createButton('Last',
|
|
88
|
+
export var First = createButton('First', "\xAB");
|
|
89
|
+
export var Prev = createButton('Prev', "\u2039");
|
|
90
|
+
export var Ellipsis = createButton('Ellipsis', "\u2026", 'More');
|
|
91
|
+
export var Next = createButton('Next', "\u203A");
|
|
92
|
+
export var Last = createButton('Last', "\xBB");
|
package/es/Panel.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import _Object$assign from
|
|
2
|
-
import _Object$values from
|
|
3
|
-
import _extends from
|
|
4
|
-
import
|
|
5
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
6
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _Object$assign from "@babel/runtime-corejs2/core-js/object/assign";
|
|
2
|
+
import _Object$values from "@babel/runtime-corejs2/core-js/object/values";
|
|
3
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
4
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
7
5
|
import classNames from 'classnames';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
7
|
import React from 'react';
|
|
10
8
|
import uncontrollable from 'uncontrollable';
|
|
11
|
-
|
|
9
|
+
import warning from 'warning';
|
|
12
10
|
import { bsStyles, bsClass, getClassSet, splitBsPropsAndOmit } from './utils/bootstrapUtils';
|
|
13
11
|
import { State, Style } from './utils/StyleConfig';
|
|
14
12
|
import Body from './PanelBody';
|
|
@@ -17,9 +15,10 @@ import Title from './PanelTitle';
|
|
|
17
15
|
import Footer from './PanelFooter';
|
|
18
16
|
import Toggle from './PanelToggle';
|
|
19
17
|
import Collapse from './PanelCollapse';
|
|
18
|
+
var has = Object.prototype.hasOwnProperty;
|
|
20
19
|
|
|
21
20
|
var defaultGetId = function defaultGetId(id, type) {
|
|
22
|
-
return id ? id +
|
|
21
|
+
return id ? id + "--" + type : null;
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
var propTypes = {
|
|
@@ -31,6 +30,7 @@ var propTypes = {
|
|
|
31
30
|
* @controllable onToggle
|
|
32
31
|
*/
|
|
33
32
|
expanded: PropTypes.bool,
|
|
33
|
+
|
|
34
34
|
/**
|
|
35
35
|
* A callback fired when the collapse state changes.
|
|
36
36
|
*
|
|
@@ -44,7 +44,6 @@ var propTypes = {
|
|
|
44
44
|
*/
|
|
45
45
|
id: PropTypes.string
|
|
46
46
|
};
|
|
47
|
-
|
|
48
47
|
var contextTypes = {
|
|
49
48
|
$bs_panelGroup: PropTypes.shape({
|
|
50
49
|
getId: PropTypes.func,
|
|
@@ -52,7 +51,6 @@ var contextTypes = {
|
|
|
52
51
|
onToggle: PropTypes.func
|
|
53
52
|
})
|
|
54
53
|
};
|
|
55
|
-
|
|
56
54
|
var childContextTypes = {
|
|
57
55
|
$bs_panel: PropTypes.shape({
|
|
58
56
|
headingId: PropTypes.string,
|
|
@@ -63,35 +61,46 @@ var childContextTypes = {
|
|
|
63
61
|
})
|
|
64
62
|
};
|
|
65
63
|
|
|
66
|
-
var Panel =
|
|
67
|
-
|
|
64
|
+
var Panel =
|
|
65
|
+
/*#__PURE__*/
|
|
66
|
+
function (_React$Component) {
|
|
67
|
+
_inheritsLoose(Panel, _React$Component);
|
|
68
68
|
|
|
69
69
|
function Panel() {
|
|
70
|
-
|
|
70
|
+
var _this;
|
|
71
71
|
|
|
72
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
72
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
73
|
args[_key] = arguments[_key];
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
77
|
+
|
|
78
|
+
_this.handleToggle = function (e) {
|
|
79
|
+
var panelGroup = _this.context.$bs_panelGroup;
|
|
80
|
+
var expanded = !_this.getExpanded();
|
|
81
|
+
|
|
82
|
+
if (panelGroup && panelGroup.onToggle) {
|
|
83
|
+
panelGroup.onToggle(_this.props.eventKey, expanded, e);
|
|
84
|
+
} else {
|
|
85
|
+
_this.props.onToggle(expanded, e);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
77
88
|
|
|
78
|
-
_this.handleToggle = _this.handleToggle.bind(_this);
|
|
79
89
|
return _this;
|
|
80
90
|
}
|
|
81
91
|
|
|
82
|
-
Panel.prototype
|
|
83
|
-
var _props = this.props,
|
|
84
|
-
eventKey = _props.eventKey,
|
|
85
|
-
id = _props.id;
|
|
92
|
+
var _proto = Panel.prototype;
|
|
86
93
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
_proto.getChildContext = function getChildContext() {
|
|
95
|
+
var _this$props = this.props,
|
|
96
|
+
eventKey = _this$props.eventKey,
|
|
97
|
+
id = _this$props.id;
|
|
91
98
|
var idKey = eventKey == null ? id : eventKey;
|
|
99
|
+
var ids;
|
|
92
100
|
|
|
93
101
|
if (idKey !== null) {
|
|
94
|
-
|
|
102
|
+
var panelGroup = this.context.$bs_panelGroup;
|
|
103
|
+
var getId = panelGroup && panelGroup.getId || defaultGetId;
|
|
95
104
|
ids = {
|
|
96
105
|
headingId: getId(idKey, 'heading'),
|
|
97
106
|
bodyId: getId(idKey, 'body')
|
|
@@ -107,52 +116,40 @@ var Panel = function (_React$Component) {
|
|
|
107
116
|
};
|
|
108
117
|
};
|
|
109
118
|
|
|
110
|
-
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
var _ref2 = this.context.$bs_panelGroup || {},
|
|
114
|
-
activeKey = _ref2.activeKey;
|
|
119
|
+
_proto.getExpanded = function getExpanded() {
|
|
120
|
+
var panelGroup = this.context.$bs_panelGroup;
|
|
115
121
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
Panel.prototype.handleToggle = function handleToggle(e) {
|
|
120
|
-
var _ref3 = this.context.$bs_panelGroup || {},
|
|
121
|
-
onToggle = _ref3.onToggle;
|
|
122
|
-
|
|
123
|
-
var expanded = !this.getExpanded();
|
|
124
|
-
|
|
125
|
-
this.props.onToggle(expanded, e);
|
|
126
|
-
if (onToggle) {
|
|
127
|
-
onToggle(this.props.eventKey, expanded, e);
|
|
122
|
+
if (panelGroup && has.call(panelGroup, 'activeKey')) {
|
|
123
|
+
process.env.NODE_ENV !== "production" ? warning(this.props.expanded == null, 'Specifying `<Panel>` `expanded` in the context of an accordion ' + '`<PanelGroup>` is not supported. Set `activeKey` on the ' + '`<PanelGroup>` instead.') : void 0;
|
|
124
|
+
return panelGroup.activeKey === this.props.eventKey;
|
|
128
125
|
}
|
|
126
|
+
|
|
127
|
+
return !!this.props.expanded;
|
|
129
128
|
};
|
|
130
129
|
|
|
131
|
-
|
|
132
|
-
var
|
|
133
|
-
className =
|
|
134
|
-
children =
|
|
130
|
+
_proto.render = function render() {
|
|
131
|
+
var _this$props2 = this.props,
|
|
132
|
+
className = _this$props2.className,
|
|
133
|
+
children = _this$props2.children;
|
|
135
134
|
|
|
136
135
|
var _splitBsPropsAndOmit = splitBsPropsAndOmit(this.props, ['onToggle', 'eventKey', 'expanded']),
|
|
137
136
|
bsProps = _splitBsPropsAndOmit[0],
|
|
138
137
|
props = _splitBsPropsAndOmit[1];
|
|
139
138
|
|
|
140
|
-
return React.createElement(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
children
|
|
144
|
-
);
|
|
139
|
+
return React.createElement("div", _extends({}, props, {
|
|
140
|
+
className: classNames(className, getClassSet(bsProps))
|
|
141
|
+
}), children);
|
|
145
142
|
};
|
|
146
143
|
|
|
147
144
|
return Panel;
|
|
148
145
|
}(React.Component);
|
|
149
146
|
|
|
150
147
|
Panel.propTypes = propTypes;
|
|
151
|
-
|
|
152
148
|
Panel.contextTypes = contextTypes;
|
|
153
149
|
Panel.childContextTypes = childContextTypes;
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
var UncontrolledPanel = uncontrollable(bsClass('panel', bsStyles(_Object$values(State).concat([Style.DEFAULT, Style.PRIMARY]), Style.DEFAULT, Panel)), {
|
|
151
|
+
expanded: 'onToggle'
|
|
152
|
+
});
|
|
156
153
|
|
|
157
154
|
_Object$assign(UncontrolledPanel, {
|
|
158
155
|
Heading: Heading,
|
package/es/PanelBody.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
4
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
5
3
|
import PropTypes from 'prop-types';
|
|
6
4
|
import React from 'react';
|
|
7
5
|
import cn from 'classnames';
|
|
8
6
|
import { prefix, splitBsPropsAndOmit, bsClass } from './utils/bootstrapUtils';
|
|
9
7
|
import PanelCollapse from './PanelCollapse';
|
|
10
|
-
|
|
11
8
|
var propTypes = {
|
|
12
9
|
/**
|
|
13
10
|
* A convenience prop that renders a Collapse component around the Body for
|
|
@@ -22,31 +19,31 @@ var propTypes = {
|
|
|
22
19
|
*/
|
|
23
20
|
collapsible: PropTypes.bool.isRequired
|
|
24
21
|
};
|
|
25
|
-
|
|
26
22
|
var defaultProps = {
|
|
27
23
|
collapsible: false
|
|
28
24
|
};
|
|
29
|
-
|
|
30
25
|
var contextTypes = {
|
|
31
26
|
$bs_panel: PropTypes.shape({
|
|
32
27
|
bsClass: PropTypes.string
|
|
33
28
|
})
|
|
34
29
|
};
|
|
35
30
|
|
|
36
|
-
var PanelBody =
|
|
37
|
-
|
|
31
|
+
var PanelBody =
|
|
32
|
+
/*#__PURE__*/
|
|
33
|
+
function (_React$Component) {
|
|
34
|
+
_inheritsLoose(PanelBody, _React$Component);
|
|
38
35
|
|
|
39
36
|
function PanelBody() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
37
|
+
return _React$Component.apply(this, arguments) || this;
|
|
43
38
|
}
|
|
44
39
|
|
|
45
|
-
PanelBody.prototype
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
var _proto = PanelBody.prototype;
|
|
41
|
+
|
|
42
|
+
_proto.render = function render() {
|
|
43
|
+
var _this$props = this.props,
|
|
44
|
+
children = _this$props.children,
|
|
45
|
+
className = _this$props.className,
|
|
46
|
+
collapsible = _this$props.collapsible;
|
|
50
47
|
|
|
51
48
|
var _ref = this.context.$bs_panel || {},
|
|
52
49
|
_bsClass = _ref.bsClass;
|
|
@@ -56,19 +53,12 @@ var PanelBody = function (_React$Component) {
|
|
|
56
53
|
elementProps = _splitBsPropsAndOmit[1];
|
|
57
54
|
|
|
58
55
|
bsProps.bsClass = _bsClass || bsProps.bsClass;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
_extends({}, elementProps, { className: cn(className, prefix(bsProps, 'body')) }),
|
|
63
|
-
children
|
|
64
|
-
);
|
|
56
|
+
var body = React.createElement("div", _extends({}, elementProps, {
|
|
57
|
+
className: cn(className, prefix(bsProps, 'body'))
|
|
58
|
+
}), children);
|
|
65
59
|
|
|
66
60
|
if (collapsible) {
|
|
67
|
-
body = React.createElement(
|
|
68
|
-
PanelCollapse,
|
|
69
|
-
null,
|
|
70
|
-
body
|
|
71
|
-
);
|
|
61
|
+
body = React.createElement(PanelCollapse, null, body);
|
|
72
62
|
}
|
|
73
63
|
|
|
74
64
|
return body;
|
|
@@ -80,5 +70,4 @@ var PanelBody = function (_React$Component) {
|
|
|
80
70
|
PanelBody.propTypes = propTypes;
|
|
81
71
|
PanelBody.defaultProps = defaultProps;
|
|
82
72
|
PanelBody.contextTypes = contextTypes;
|
|
83
|
-
|
|
84
73
|
export default bsClass('panel', PanelBody);
|