react-bootstrap 0.31.3 → 0.32.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/CHANGELOG.md +57 -0
- package/README.md +1 -0
- package/dist/react-bootstrap.js +14493 -17076
- package/dist/react-bootstrap.min.js +18479 -16
- package/es/Alert.js +1 -4
- package/es/Badge.js +1 -3
- package/es/ButtonGroup.js +1 -3
- package/es/Carousel.js +79 -79
- package/es/CarouselCaption.js +1 -3
- package/es/CarouselItem.js +3 -9
- package/es/Checkbox.js +7 -1
- package/es/Clearfix.js +1 -3
- package/es/CloseButton.js +1 -5
- package/es/Col.js +1 -3
- package/es/Collapse.js +58 -65
- package/es/Dropdown.js +66 -55
- package/es/DropdownButton.js +2 -8
- package/es/DropdownMenu.js +28 -28
- package/es/Fade.js +25 -10
- package/es/Form.js +1 -3
- package/es/FormControl.js +1 -2
- package/es/FormControlStatic.js +1 -3
- package/es/FormGroup.js +1 -3
- package/es/Glyphicon.js +1 -3
- package/es/Grid.js +1 -3
- package/es/HelpBlock.js +1 -3
- package/es/InputGroup.js +1 -3
- package/es/InputGroupAddon.js +1 -3
- package/es/InputGroupButton.js +1 -3
- package/es/Jumbotron.js +1 -3
- package/es/Label.js +1 -3
- package/es/ListGroup.js +1 -3
- package/es/Media.js +1 -3
- package/es/MediaBody.js +16 -5
- package/es/MediaHeading.js +1 -3
- package/es/MediaLeft.js +1 -3
- package/es/MediaList.js +1 -3
- package/es/MediaListItem.js +1 -3
- package/es/MediaRight.js +1 -3
- package/es/Modal.js +30 -19
- package/es/ModalBody.js +1 -3
- package/es/ModalFooter.js +1 -3
- package/es/ModalHeader.js +2 -4
- package/es/ModalTitle.js +1 -3
- package/es/Nav.js +44 -44
- package/es/NavDropdown.js +2 -0
- package/es/NavItem.js +5 -4
- package/es/Navbar.js +5 -7
- package/es/Overlay.js +1 -3
- package/es/OverlayTrigger.js +43 -43
- package/es/PageHeader.js +1 -3
- package/es/Pager.js +1 -3
- package/es/PagerItem.js +1 -4
- package/es/Pagination.js +15 -224
- package/es/PaginationItem.js +102 -0
- package/es/Panel.js +114 -173
- package/es/PanelBody.js +84 -0
- package/es/PanelCollapse.js +94 -0
- package/es/PanelFooter.js +53 -0
- package/es/PanelGroup.js +95 -52
- package/es/PanelHeading.js +75 -0
- package/es/PanelTitle.js +83 -0
- package/es/PanelToggle.js +94 -0
- package/es/ProgressBar.js +12 -8
- package/es/Radio.js +7 -1
- package/es/Row.js +1 -3
- package/es/SplitButton.js +1 -4
- package/es/SplitToggle.js +1 -4
- package/es/TabContent.js +7 -7
- package/es/TabPane.js +18 -18
- package/es/Table.js +1 -3
- package/es/Tabs.js +4 -10
- package/es/Thumbnail.js +3 -3
- package/es/ToggleButton.js +1 -4
- package/es/Well.js +1 -3
- package/es/index.js +0 -2
- package/es/utils/PropTypes.js +26 -4
- package/es/utils/ValidComponentChildren.js +1 -1
- package/es/utils/bootstrapUtils.js +5 -3
- package/lib/Accordion.js +9 -9
- package/lib/Alert.js +14 -17
- package/lib/Badge.js +12 -14
- package/lib/Breadcrumb.js +10 -10
- package/lib/BreadcrumbItem.js +14 -14
- package/lib/Button.js +20 -20
- package/lib/ButtonGroup.js +12 -14
- package/lib/ButtonToolbar.js +9 -9
- package/lib/Carousel.js +121 -121
- package/lib/CarouselCaption.js +9 -11
- package/lib/CarouselItem.js +17 -22
- package/lib/Checkbox.js +25 -21
- package/lib/Clearfix.js +14 -16
- package/lib/CloseButton.js +12 -16
- package/lib/Col.js +29 -31
- package/lib/Collapse.js +84 -92
- package/lib/ControlLabel.js +14 -14
- package/lib/Dropdown.js +106 -95
- package/lib/DropdownButton.js +22 -28
- package/lib/DropdownMenu.js +51 -51
- package/lib/DropdownToggle.js +16 -16
- package/lib/Fade.js +43 -25
- package/lib/Form.js +11 -13
- package/lib/FormControl.js +17 -17
- package/lib/FormControlFeedback.js +13 -13
- package/lib/FormControlStatic.js +9 -11
- package/lib/FormGroup.js +14 -16
- package/lib/Glyphicon.js +10 -12
- package/lib/Grid.js +10 -12
- package/lib/HelpBlock.js +8 -10
- package/lib/Image.js +13 -13
- package/lib/InputGroup.js +10 -12
- package/lib/InputGroupAddon.js +8 -10
- package/lib/InputGroupButton.js +8 -10
- package/lib/Jumbotron.js +9 -11
- package/lib/Label.js +11 -13
- package/lib/ListGroup.js +15 -17
- package/lib/ListGroupItem.js +22 -22
- package/lib/Media.js +15 -17
- package/lib/MediaBody.js +28 -11
- package/lib/MediaHeading.js +9 -11
- package/lib/MediaLeft.js +10 -12
- package/lib/MediaList.js +8 -10
- package/lib/MediaListItem.js +8 -10
- package/lib/MediaRight.js +10 -12
- package/lib/MenuItem.js +23 -23
- package/lib/Modal.js +80 -69
- package/lib/ModalBody.js +9 -11
- package/lib/ModalDialog.js +16 -16
- package/lib/ModalFooter.js +9 -11
- package/lib/ModalHeader.js +20 -22
- package/lib/ModalTitle.js +9 -11
- package/lib/Nav.js +81 -81
- package/lib/NavDropdown.js +27 -25
- package/lib/NavItem.js +23 -22
- package/lib/Navbar.js +46 -48
- package/lib/NavbarBrand.js +14 -14
- package/lib/NavbarCollapse.js +14 -14
- package/lib/NavbarHeader.js +10 -10
- package/lib/NavbarToggle.js +22 -22
- package/lib/Overlay.js +25 -27
- package/lib/OverlayTrigger.js +79 -79
- package/lib/PageHeader.js +10 -12
- package/lib/PageItem.js +2 -2
- package/lib/Pager.js +13 -15
- package/lib/PagerItem.js +18 -21
- package/lib/Pagination.js +25 -240
- package/lib/PaginationItem.js +135 -0
- package/lib/Panel.js +142 -180
- package/lib/PanelBody.js +114 -0
- package/lib/PanelCollapse.js +120 -0
- package/lib/PanelFooter.js +80 -0
- package/lib/PanelGroup.js +111 -70
- package/lib/PanelHeading.js +107 -0
- package/lib/PanelTitle.js +118 -0
- package/lib/PanelToggle.js +130 -0
- package/lib/Popover.js +22 -22
- package/lib/ProgressBar.js +39 -35
- package/lib/Radio.js +25 -21
- package/lib/ResponsiveEmbed.js +17 -17
- package/lib/Row.js +9 -11
- package/lib/SafeAnchor.js +17 -17
- package/lib/SplitButton.js +26 -29
- package/lib/SplitToggle.js +8 -11
- package/lib/Tab.js +15 -15
- package/lib/TabContainer.js +17 -17
- package/lib/TabContent.js +31 -31
- package/lib/TabPane.js +59 -59
- package/lib/Table.js +15 -17
- package/lib/Tabs.js +29 -35
- package/lib/Thumbnail.js +18 -20
- package/lib/ToggleButton.js +17 -20
- package/lib/ToggleButtonGroup.js +20 -20
- package/lib/Tooltip.js +20 -20
- package/lib/Well.js +8 -10
- package/lib/index.js +74 -79
- package/lib/utils/PropTypes.js +35 -9
- package/lib/utils/ValidComponentChildren.js +19 -19
- package/lib/utils/bootstrapUtils.js +13 -11
- package/lib/utils/capitalize.js +1 -1
- package/lib/utils/createChainedFunction.js +1 -1
- package/lib/utils/deprecationWarning.js +7 -7
- package/lib/utils/index.js +4 -4
- package/lib/utils/splitComponentProps.js +3 -3
- package/package.json +54 -64
- package/dist/react-bootstrap.min.js.map +0 -1
- package/es/PaginationButton.js +0 -98
- package/es/utils/TransitionEvents.js +0 -109
- package/lib/PaginationButton.js +0 -137
- package/lib/utils/TransitionEvents.js +0 -113
package/lib/SplitButton.js
CHANGED
|
@@ -46,37 +46,37 @@ var _splitComponentProps2 = require('./utils/splitComponentProps');
|
|
|
46
46
|
|
|
47
47
|
var _splitComponentProps3 = _interopRequireDefault(_splitComponentProps2);
|
|
48
48
|
|
|
49
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
49
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
50
50
|
|
|
51
|
-
var propTypes = (0, _extends3
|
|
51
|
+
var propTypes = (0, _extends3.default)({}, _Dropdown2.default.propTypes, {
|
|
52
52
|
|
|
53
53
|
// Toggle props.
|
|
54
|
-
bsStyle: _propTypes2
|
|
55
|
-
bsSize: _propTypes2
|
|
56
|
-
href: _propTypes2
|
|
57
|
-
onClick: _propTypes2
|
|
54
|
+
bsStyle: _propTypes2.default.string,
|
|
55
|
+
bsSize: _propTypes2.default.string,
|
|
56
|
+
href: _propTypes2.default.string,
|
|
57
|
+
onClick: _propTypes2.default.func,
|
|
58
58
|
/**
|
|
59
59
|
* The content of the split button.
|
|
60
60
|
*/
|
|
61
|
-
title: _propTypes2
|
|
61
|
+
title: _propTypes2.default.node.isRequired,
|
|
62
62
|
/**
|
|
63
63
|
* Accessible label for the toggle; the value of `title` if not specified.
|
|
64
64
|
*/
|
|
65
|
-
toggleLabel: _propTypes2
|
|
65
|
+
toggleLabel: _propTypes2.default.string,
|
|
66
66
|
|
|
67
67
|
// Override generated docs from <Dropdown>.
|
|
68
68
|
/**
|
|
69
69
|
* @private
|
|
70
70
|
*/
|
|
71
|
-
children: _propTypes2
|
|
71
|
+
children: _propTypes2.default.node
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
var SplitButton = function (_React$Component) {
|
|
75
|
-
(0, _inherits3
|
|
75
|
+
(0, _inherits3.default)(SplitButton, _React$Component);
|
|
76
76
|
|
|
77
77
|
function SplitButton() {
|
|
78
|
-
(0, _classCallCheck3
|
|
79
|
-
return (0, _possibleConstructorReturn3
|
|
78
|
+
(0, _classCallCheck3.default)(this, SplitButton);
|
|
79
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
SplitButton.prototype.render = function render() {
|
|
@@ -86,34 +86,31 @@ var SplitButton = function (_React$Component) {
|
|
|
86
86
|
title = _props.title,
|
|
87
87
|
toggleLabel = _props.toggleLabel,
|
|
88
88
|
children = _props.children,
|
|
89
|
-
props = (0, _objectWithoutProperties3
|
|
89
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['bsSize', 'bsStyle', 'title', 'toggleLabel', 'children']);
|
|
90
90
|
|
|
91
|
-
var _splitComponentProps = (0, _splitComponentProps3
|
|
91
|
+
var _splitComponentProps = (0, _splitComponentProps3.default)(props, _Dropdown2.default.ControlledComponent),
|
|
92
92
|
dropdownProps = _splitComponentProps[0],
|
|
93
93
|
buttonProps = _splitComponentProps[1];
|
|
94
94
|
|
|
95
|
-
return _react2
|
|
96
|
-
_Dropdown2
|
|
97
|
-
(0, _extends3
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
_react2['default'].createElement(
|
|
102
|
-
_Button2['default'],
|
|
103
|
-
(0, _extends3['default'])({}, buttonProps, {
|
|
95
|
+
return _react2.default.createElement(
|
|
96
|
+
_Dropdown2.default,
|
|
97
|
+
(0, _extends3.default)({}, dropdownProps, { bsSize: bsSize, bsStyle: bsStyle }),
|
|
98
|
+
_react2.default.createElement(
|
|
99
|
+
_Button2.default,
|
|
100
|
+
(0, _extends3.default)({}, buttonProps, {
|
|
104
101
|
disabled: props.disabled,
|
|
105
102
|
bsSize: bsSize,
|
|
106
103
|
bsStyle: bsStyle
|
|
107
104
|
}),
|
|
108
105
|
title
|
|
109
106
|
),
|
|
110
|
-
_react2
|
|
107
|
+
_react2.default.createElement(_SplitToggle2.default, {
|
|
111
108
|
'aria-label': toggleLabel || title,
|
|
112
109
|
bsSize: bsSize,
|
|
113
110
|
bsStyle: bsStyle
|
|
114
111
|
}),
|
|
115
|
-
_react2
|
|
116
|
-
_Dropdown2
|
|
112
|
+
_react2.default.createElement(
|
|
113
|
+
_Dropdown2.default.Menu,
|
|
117
114
|
null,
|
|
118
115
|
children
|
|
119
116
|
)
|
|
@@ -121,11 +118,11 @@ var SplitButton = function (_React$Component) {
|
|
|
121
118
|
};
|
|
122
119
|
|
|
123
120
|
return SplitButton;
|
|
124
|
-
}(_react2
|
|
121
|
+
}(_react2.default.Component);
|
|
125
122
|
|
|
126
123
|
SplitButton.propTypes = propTypes;
|
|
127
124
|
|
|
128
|
-
SplitButton.Toggle = _SplitToggle2
|
|
125
|
+
SplitButton.Toggle = _SplitToggle2.default;
|
|
129
126
|
|
|
130
|
-
exports
|
|
127
|
+
exports.default = SplitButton;
|
|
131
128
|
module.exports = exports['default'];
|
package/lib/SplitToggle.js
CHANGED
|
@@ -26,27 +26,24 @@ var _DropdownToggle = require('./DropdownToggle');
|
|
|
26
26
|
|
|
27
27
|
var _DropdownToggle2 = _interopRequireDefault(_DropdownToggle);
|
|
28
28
|
|
|
29
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
29
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
30
|
|
|
31
31
|
var SplitToggle = function (_React$Component) {
|
|
32
|
-
(0, _inherits3
|
|
32
|
+
(0, _inherits3.default)(SplitToggle, _React$Component);
|
|
33
33
|
|
|
34
34
|
function SplitToggle() {
|
|
35
|
-
(0, _classCallCheck3
|
|
36
|
-
return (0, _possibleConstructorReturn3
|
|
35
|
+
(0, _classCallCheck3.default)(this, SplitToggle);
|
|
36
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
SplitToggle.prototype.render = function render() {
|
|
40
|
-
return _react2
|
|
41
|
-
useAnchor: false,
|
|
42
|
-
noCaret: false
|
|
43
|
-
}));
|
|
40
|
+
return _react2.default.createElement(_DropdownToggle2.default, (0, _extends3.default)({}, this.props, { useAnchor: false, noCaret: false }));
|
|
44
41
|
};
|
|
45
42
|
|
|
46
43
|
return SplitToggle;
|
|
47
|
-
}(_react2
|
|
44
|
+
}(_react2.default.Component);
|
|
48
45
|
|
|
49
|
-
SplitToggle.defaultProps = _DropdownToggle2
|
|
46
|
+
SplitToggle.defaultProps = _DropdownToggle2.default.defaultProps;
|
|
50
47
|
|
|
51
|
-
exports
|
|
48
|
+
exports.default = SplitToggle;
|
|
52
49
|
module.exports = exports['default'];
|
package/lib/Tab.js
CHANGED
|
@@ -38,47 +38,47 @@ var _TabPane = require('./TabPane');
|
|
|
38
38
|
|
|
39
39
|
var _TabPane2 = _interopRequireDefault(_TabPane);
|
|
40
40
|
|
|
41
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
41
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
42
42
|
|
|
43
|
-
var propTypes = (0, _extends3
|
|
43
|
+
var propTypes = (0, _extends3.default)({}, _TabPane2.default.propTypes, {
|
|
44
44
|
|
|
45
|
-
disabled: _propTypes2
|
|
45
|
+
disabled: _propTypes2.default.bool,
|
|
46
46
|
|
|
47
|
-
title: _propTypes2
|
|
47
|
+
title: _propTypes2.default.node,
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* tabClassName is used as className for the associated NavItem
|
|
51
51
|
*/
|
|
52
|
-
tabClassName: _propTypes2
|
|
52
|
+
tabClassName: _propTypes2.default.string
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
var Tab = function (_React$Component) {
|
|
56
|
-
(0, _inherits3
|
|
56
|
+
(0, _inherits3.default)(Tab, _React$Component);
|
|
57
57
|
|
|
58
58
|
function Tab() {
|
|
59
|
-
(0, _classCallCheck3
|
|
60
|
-
return (0, _possibleConstructorReturn3
|
|
59
|
+
(0, _classCallCheck3.default)(this, Tab);
|
|
60
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
Tab.prototype.render = function render() {
|
|
64
|
-
var props = (0, _extends3
|
|
64
|
+
var props = (0, _extends3.default)({}, this.props);
|
|
65
65
|
|
|
66
66
|
// These props are for the parent `<Tabs>` rather than the `<TabPane>`.
|
|
67
67
|
delete props.title;
|
|
68
68
|
delete props.disabled;
|
|
69
69
|
delete props.tabClassName;
|
|
70
70
|
|
|
71
|
-
return _react2
|
|
71
|
+
return _react2.default.createElement(_TabPane2.default, props);
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
return Tab;
|
|
75
|
-
}(_react2
|
|
75
|
+
}(_react2.default.Component);
|
|
76
76
|
|
|
77
77
|
Tab.propTypes = propTypes;
|
|
78
78
|
|
|
79
|
-
Tab.Container = _TabContainer2
|
|
80
|
-
Tab.Content = _TabContent2
|
|
81
|
-
Tab.Pane = _TabPane2
|
|
79
|
+
Tab.Container = _TabContainer2.default;
|
|
80
|
+
Tab.Content = _TabContent2.default;
|
|
81
|
+
Tab.Pane = _TabPane2.default;
|
|
82
82
|
|
|
83
|
-
exports
|
|
83
|
+
exports.default = Tab;
|
|
84
84
|
module.exports = exports['default'];
|
package/lib/TabContainer.js
CHANGED
|
@@ -30,12 +30,12 @@ var _uncontrollable = require('uncontrollable');
|
|
|
30
30
|
|
|
31
31
|
var _uncontrollable2 = _interopRequireDefault(_uncontrollable);
|
|
32
32
|
|
|
33
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
33
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
34
|
|
|
35
35
|
var TAB = 'tab';
|
|
36
36
|
var PANE = 'pane';
|
|
37
37
|
|
|
38
|
-
var idPropType = _propTypes2
|
|
38
|
+
var idPropType = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]);
|
|
39
39
|
|
|
40
40
|
var propTypes = {
|
|
41
41
|
/**
|
|
@@ -72,38 +72,38 @@ var propTypes = {
|
|
|
72
72
|
*
|
|
73
73
|
* @defaultValue (eventKey, type) => `${this.props.id}-${type}-${key}`
|
|
74
74
|
*/
|
|
75
|
-
generateChildId: _propTypes2
|
|
75
|
+
generateChildId: _propTypes2.default.func,
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* A callback fired when a tab is selected.
|
|
79
79
|
*
|
|
80
80
|
* @controllable activeKey
|
|
81
81
|
*/
|
|
82
|
-
onSelect: _propTypes2
|
|
82
|
+
onSelect: _propTypes2.default.func,
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* The `eventKey` of the currently active tab.
|
|
86
86
|
*
|
|
87
87
|
* @controllable onSelect
|
|
88
88
|
*/
|
|
89
|
-
activeKey: _propTypes2
|
|
89
|
+
activeKey: _propTypes2.default.any
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
var childContextTypes = {
|
|
93
|
-
$bs_tabContainer: _propTypes2
|
|
94
|
-
activeKey: _propTypes2
|
|
95
|
-
onSelect: _propTypes2
|
|
96
|
-
getTabId: _propTypes2
|
|
97
|
-
getPaneId: _propTypes2
|
|
93
|
+
$bs_tabContainer: _propTypes2.default.shape({
|
|
94
|
+
activeKey: _propTypes2.default.any,
|
|
95
|
+
onSelect: _propTypes2.default.func.isRequired,
|
|
96
|
+
getTabId: _propTypes2.default.func.isRequired,
|
|
97
|
+
getPaneId: _propTypes2.default.func.isRequired
|
|
98
98
|
})
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
var TabContainer = function (_React$Component) {
|
|
102
|
-
(0, _inherits3
|
|
102
|
+
(0, _inherits3.default)(TabContainer, _React$Component);
|
|
103
103
|
|
|
104
104
|
function TabContainer() {
|
|
105
|
-
(0, _classCallCheck3
|
|
106
|
-
return (0, _possibleConstructorReturn3
|
|
105
|
+
(0, _classCallCheck3.default)(this, TabContainer);
|
|
106
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
TabContainer.prototype.getChildContext = function getChildContext() {
|
|
@@ -135,21 +135,21 @@ var TabContainer = function (_React$Component) {
|
|
|
135
135
|
TabContainer.prototype.render = function render() {
|
|
136
136
|
var _props2 = this.props,
|
|
137
137
|
children = _props2.children,
|
|
138
|
-
props = (0, _objectWithoutProperties3
|
|
138
|
+
props = (0, _objectWithoutProperties3.default)(_props2, ['children']);
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
delete props.generateChildId;
|
|
142
142
|
delete props.onSelect;
|
|
143
143
|
delete props.activeKey;
|
|
144
144
|
|
|
145
|
-
return _react2
|
|
145
|
+
return _react2.default.cloneElement(_react2.default.Children.only(children), props);
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
return TabContainer;
|
|
149
|
-
}(_react2
|
|
149
|
+
}(_react2.default.Component);
|
|
150
150
|
|
|
151
151
|
TabContainer.propTypes = propTypes;
|
|
152
152
|
TabContainer.childContextTypes = childContextTypes;
|
|
153
153
|
|
|
154
|
-
exports
|
|
154
|
+
exports.default = (0, _uncontrollable2.default)(TabContainer, { activeKey: 'onSelect' });
|
|
155
155
|
module.exports = exports['default'];
|
package/lib/TabContent.js
CHANGED
|
@@ -40,27 +40,27 @@ var _elementType2 = _interopRequireDefault(_elementType);
|
|
|
40
40
|
|
|
41
41
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
42
42
|
|
|
43
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
43
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
44
|
|
|
45
45
|
var propTypes = {
|
|
46
|
-
componentClass: _elementType2
|
|
46
|
+
componentClass: _elementType2.default,
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Sets a default animation strategy for all children `<TabPane>`s. Use
|
|
50
|
-
* `false` to disable, `true` to enable the default `<Fade>` animation or
|
|
51
|
-
* `<Transition
|
|
50
|
+
* `false` to disable, `true` to enable the default `<Fade>` animation or
|
|
51
|
+
* a react-transition-group v2 `<Transition/>` component.
|
|
52
52
|
*/
|
|
53
|
-
animation: _propTypes2
|
|
53
|
+
animation: _propTypes2.default.oneOfType([_propTypes2.default.bool, _elementType2.default]),
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Wait until the first "enter" transition to mount tabs (add them to the DOM)
|
|
57
57
|
*/
|
|
58
|
-
mountOnEnter: _propTypes2
|
|
58
|
+
mountOnEnter: _propTypes2.default.bool,
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Unmount tabs (remove it from the DOM) when they are no longer visible
|
|
62
62
|
*/
|
|
63
|
-
unmountOnExit: _propTypes2
|
|
63
|
+
unmountOnExit: _propTypes2.default.bool
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
var defaultProps = {
|
|
@@ -71,31 +71,31 @@ var defaultProps = {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
var contextTypes = {
|
|
74
|
-
$bs_tabContainer: _propTypes2
|
|
75
|
-
activeKey: _propTypes2
|
|
74
|
+
$bs_tabContainer: _propTypes2.default.shape({
|
|
75
|
+
activeKey: _propTypes2.default.any
|
|
76
76
|
})
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
var childContextTypes = {
|
|
80
|
-
$bs_tabContent: _propTypes2
|
|
81
|
-
bsClass: _propTypes2
|
|
82
|
-
animation: _propTypes2
|
|
83
|
-
activeKey: _propTypes2
|
|
84
|
-
mountOnEnter: _propTypes2
|
|
85
|
-
unmountOnExit: _propTypes2
|
|
86
|
-
onPaneEnter: _propTypes2
|
|
87
|
-
onPaneExited: _propTypes2
|
|
88
|
-
exiting: _propTypes2
|
|
80
|
+
$bs_tabContent: _propTypes2.default.shape({
|
|
81
|
+
bsClass: _propTypes2.default.string,
|
|
82
|
+
animation: _propTypes2.default.oneOfType([_propTypes2.default.bool, _elementType2.default]),
|
|
83
|
+
activeKey: _propTypes2.default.any,
|
|
84
|
+
mountOnEnter: _propTypes2.default.bool,
|
|
85
|
+
unmountOnExit: _propTypes2.default.bool,
|
|
86
|
+
onPaneEnter: _propTypes2.default.func.isRequired,
|
|
87
|
+
onPaneExited: _propTypes2.default.func.isRequired,
|
|
88
|
+
exiting: _propTypes2.default.bool.isRequired
|
|
89
89
|
})
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
var TabContent = function (_React$Component) {
|
|
93
|
-
(0, _inherits3
|
|
93
|
+
(0, _inherits3.default)(TabContent, _React$Component);
|
|
94
94
|
|
|
95
95
|
function TabContent(props, context) {
|
|
96
|
-
(0, _classCallCheck3
|
|
96
|
+
(0, _classCallCheck3.default)(this, TabContent);
|
|
97
97
|
|
|
98
|
-
var _this = (0, _possibleConstructorReturn3
|
|
98
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
|
|
99
99
|
|
|
100
100
|
_this.handlePaneEnter = _this.handlePaneEnter.bind(_this);
|
|
101
101
|
_this.handlePaneExited = _this.handlePaneExited.bind(_this);
|
|
@@ -148,6 +148,11 @@ var TabContent = function (_React$Component) {
|
|
|
148
148
|
this.isUnmounted = true;
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
+
TabContent.prototype.getContainerActiveKey = function getContainerActiveKey() {
|
|
152
|
+
var tabContainer = this.context.$bs_tabContainer;
|
|
153
|
+
return tabContainer && tabContainer.activeKey;
|
|
154
|
+
};
|
|
155
|
+
|
|
151
156
|
TabContent.prototype.handlePaneEnter = function handlePaneEnter(child, childKey) {
|
|
152
157
|
if (!this.props.animation) {
|
|
153
158
|
return false;
|
|
@@ -186,33 +191,28 @@ var TabContent = function (_React$Component) {
|
|
|
186
191
|
});
|
|
187
192
|
};
|
|
188
193
|
|
|
189
|
-
TabContent.prototype.getContainerActiveKey = function getContainerActiveKey() {
|
|
190
|
-
var tabContainer = this.context.$bs_tabContainer;
|
|
191
|
-
return tabContainer && tabContainer.activeKey;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
194
|
TabContent.prototype.render = function render() {
|
|
195
195
|
var _props2 = this.props,
|
|
196
196
|
Component = _props2.componentClass,
|
|
197
197
|
className = _props2.className,
|
|
198
|
-
props = (0, _objectWithoutProperties3
|
|
198
|
+
props = (0, _objectWithoutProperties3.default)(_props2, ['componentClass', 'className']);
|
|
199
199
|
|
|
200
200
|
var _splitBsPropsAndOmit = (0, _bootstrapUtils.splitBsPropsAndOmit)(props, ['animation', 'mountOnEnter', 'unmountOnExit']),
|
|
201
201
|
bsProps = _splitBsPropsAndOmit[0],
|
|
202
202
|
elementProps = _splitBsPropsAndOmit[1];
|
|
203
203
|
|
|
204
|
-
return _react2
|
|
205
|
-
className: (0, _classnames2
|
|
204
|
+
return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, {
|
|
205
|
+
className: (0, _classnames2.default)(className, (0, _bootstrapUtils.prefix)(bsProps, 'content'))
|
|
206
206
|
}));
|
|
207
207
|
};
|
|
208
208
|
|
|
209
209
|
return TabContent;
|
|
210
|
-
}(_react2
|
|
210
|
+
}(_react2.default.Component);
|
|
211
211
|
|
|
212
212
|
TabContent.propTypes = propTypes;
|
|
213
213
|
TabContent.defaultProps = defaultProps;
|
|
214
214
|
TabContent.contextTypes = contextTypes;
|
|
215
215
|
TabContent.childContextTypes = childContextTypes;
|
|
216
216
|
|
|
217
|
-
exports
|
|
217
|
+
exports.default = (0, _bootstrapUtils.bsClass)('tab', TabContent);
|
|
218
218
|
module.exports = exports['default'];
|