react-bootstrap 0.30.6 → 0.30.10
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 +64 -0
- package/LICENSE +2 -2
- package/dist/react-bootstrap.js +3161 -1664
- package/dist/react-bootstrap.min.js +9 -9
- package/dist/react-bootstrap.min.js.map +1 -1
- package/es/Alert.js +3 -2
- package/es/Badge.js +2 -1
- package/es/BreadcrumbItem.js +5 -4
- package/es/Button.js +7 -6
- package/es/ButtonGroup.js +4 -3
- package/es/Carousel.js +17 -16
- package/es/CarouselItem.js +7 -6
- package/es/Checkbox.js +5 -4
- package/es/Clearfix.js +5 -4
- package/es/Col.js +21 -20
- package/es/Collapse.js +20 -13
- package/es/ControlLabel.js +4 -3
- package/es/Dropdown.js +34 -22
- package/es/DropdownButton.js +6 -5
- package/es/DropdownMenu.js +19 -14
- package/es/DropdownToggle.js +5 -4
- package/es/Fade.js +17 -10
- package/es/Form.js +3 -2
- package/es/FormControl.js +27 -6
- package/es/FormControlFeedback.js +2 -1
- package/es/FormGroup.js +4 -3
- package/es/Glyphicon.js +3 -2
- package/es/Grid.js +2 -1
- package/es/Image.js +5 -4
- package/es/ListGroupItem.js +8 -7
- package/es/MediaLeft.js +2 -1
- package/es/MediaRight.js +2 -1
- package/es/MenuItem.js +9 -8
- package/es/Modal.js +22 -15
- package/es/ModalBody.js +15 -2
- package/es/ModalDialog.js +2 -1
- package/es/ModalFooter.js +15 -2
- package/es/ModalHeader.js +7 -6
- package/es/ModalTitle.js +15 -2
- package/es/Nav.js +20 -19
- package/es/NavDropdown.js +5 -4
- package/es/NavItem.js +8 -7
- package/es/Navbar.js +17 -15
- package/es/NavbarBrand.js +3 -2
- package/es/NavbarCollapse.js +2 -1
- package/es/NavbarHeader.js +3 -2
- package/es/NavbarToggle.js +2 -1
- package/es/Overlay.js +18 -11
- package/es/OverlayTrigger.js +20 -18
- package/es/Pager.js +2 -1
- package/es/PagerItem.js +7 -6
- package/es/Pagination.js +54 -60
- package/es/PaginationButton.js +7 -6
- package/es/Panel.js +17 -20
- package/es/PanelGroup.js +6 -5
- package/es/Popover.js +8 -7
- package/es/ProgressBar.js +2 -1
- package/es/Radio.js +5 -4
- package/es/ResponsiveEmbed.js +2 -1
- package/es/SafeAnchor.js +6 -5
- package/es/SplitButton.js +8 -7
- package/es/Tab.js +4 -3
- package/es/TabContainer.js +3 -2
- package/es/TabContent.js +12 -2
- package/es/TabPane.js +15 -5
- package/es/Table.js +6 -5
- package/es/Tabs.js +16 -7
- package/es/Thumbnail.js +4 -3
- package/es/Tooltip.js +7 -6
- package/es/index.js +2 -0
- package/es/utils/bootstrapUtils.js +1 -1
- package/lib/Alert.js +6 -2
- package/lib/Badge.js +5 -1
- package/lib/BreadcrumbItem.js +8 -4
- package/lib/Button.js +10 -6
- package/lib/ButtonGroup.js +7 -3
- package/lib/Carousel.js +20 -16
- package/lib/CarouselItem.js +10 -6
- package/lib/Checkbox.js +8 -4
- package/lib/Clearfix.js +8 -4
- package/lib/Col.js +24 -20
- package/lib/Collapse.js +23 -13
- package/lib/ControlLabel.js +7 -3
- package/lib/Dropdown.js +37 -22
- package/lib/DropdownButton.js +9 -5
- package/lib/DropdownMenu.js +21 -13
- package/lib/DropdownToggle.js +8 -4
- package/lib/Fade.js +20 -10
- package/lib/Form.js +6 -2
- package/lib/FormControl.js +29 -5
- package/lib/FormControlFeedback.js +5 -1
- package/lib/FormGroup.js +7 -3
- package/lib/Glyphicon.js +6 -2
- package/lib/Grid.js +5 -1
- package/lib/Image.js +8 -4
- package/lib/ListGroupItem.js +11 -7
- package/lib/MediaLeft.js +5 -1
- package/lib/MediaRight.js +5 -1
- package/lib/MenuItem.js +12 -8
- package/lib/Modal.js +25 -15
- package/lib/ModalBody.js +18 -2
- package/lib/ModalDialog.js +5 -1
- package/lib/ModalFooter.js +18 -2
- package/lib/ModalHeader.js +10 -6
- package/lib/ModalTitle.js +18 -2
- package/lib/Nav.js +23 -19
- package/lib/NavDropdown.js +8 -4
- package/lib/NavItem.js +11 -7
- package/lib/Navbar.js +27 -25
- package/lib/NavbarBrand.js +6 -2
- package/lib/NavbarCollapse.js +7 -3
- package/lib/NavbarHeader.js +6 -2
- package/lib/NavbarToggle.js +10 -6
- package/lib/Overlay.js +21 -11
- package/lib/OverlayTrigger.js +23 -18
- package/lib/Pager.js +5 -1
- package/lib/PagerItem.js +10 -6
- package/lib/Pagination.js +58 -61
- package/lib/PaginationButton.js +10 -6
- package/lib/Panel.js +20 -20
- package/lib/PanelGroup.js +9 -5
- package/lib/Popover.js +11 -7
- package/lib/ProgressBar.js +12 -8
- package/lib/Radio.js +8 -4
- package/lib/ResponsiveEmbed.js +7 -3
- package/lib/SafeAnchor.js +9 -5
- package/lib/SplitButton.js +11 -7
- package/lib/Tab.js +7 -3
- package/lib/TabContainer.js +13 -9
- package/lib/TabContent.js +26 -13
- package/lib/TabPane.js +38 -25
- package/lib/Table.js +9 -5
- package/lib/Tabs.js +19 -7
- package/lib/Thumbnail.js +7 -3
- package/lib/Tooltip.js +10 -6
- package/lib/index.js +6 -1
- package/lib/utils/bootstrapUtils.js +6 -4
- package/package.json +10 -8
package/lib/Modal.js
CHANGED
|
@@ -46,6 +46,10 @@ var _react = require('react');
|
|
|
46
46
|
|
|
47
47
|
var _react2 = _interopRequireDefault(_react);
|
|
48
48
|
|
|
49
|
+
var _propTypes = require('prop-types');
|
|
50
|
+
|
|
51
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
52
|
+
|
|
49
53
|
var _reactDom = require('react-dom');
|
|
50
54
|
|
|
51
55
|
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
@@ -106,17 +110,17 @@ var propTypes = (0, _extends3['default'])({}, _Modal2['default'].propTypes, _Mod
|
|
|
106
110
|
* Include a backdrop component. Specify 'static' for a backdrop that doesn't
|
|
107
111
|
* trigger an "onHide" when clicked.
|
|
108
112
|
*/
|
|
109
|
-
backdrop:
|
|
113
|
+
backdrop: _propTypes2['default'].oneOf(['static', true, false]),
|
|
110
114
|
|
|
111
115
|
/**
|
|
112
116
|
* Close the modal when escape key is pressed
|
|
113
117
|
*/
|
|
114
|
-
keyboard:
|
|
118
|
+
keyboard: _propTypes2['default'].bool,
|
|
115
119
|
|
|
116
120
|
/**
|
|
117
121
|
* Open and close the Modal with a slide and fade animation.
|
|
118
122
|
*/
|
|
119
|
-
animation:
|
|
123
|
+
animation: _propTypes2['default'].bool,
|
|
120
124
|
|
|
121
125
|
/**
|
|
122
126
|
* A Component type that provides the modal content Markup. This is a useful
|
|
@@ -131,55 +135,61 @@ var propTypes = (0, _extends3['default'])({}, _Modal2['default'].propTypes, _Mod
|
|
|
131
135
|
* Generally this should never be set to false as it makes the Modal less
|
|
132
136
|
* accessible to assistive technologies, like screen-readers.
|
|
133
137
|
*/
|
|
134
|
-
autoFocus:
|
|
138
|
+
autoFocus: _propTypes2['default'].bool,
|
|
135
139
|
|
|
136
140
|
/**
|
|
137
141
|
* When `true` The modal will prevent focus from leaving the Modal while
|
|
138
142
|
* open. Consider leaving the default value here, as it is necessary to make
|
|
139
143
|
* the Modal work well with assistive technologies, such as screen readers.
|
|
140
144
|
*/
|
|
141
|
-
enforceFocus:
|
|
145
|
+
enforceFocus: _propTypes2['default'].bool,
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* When `true` The modal will restore focus to previously focused element once
|
|
149
|
+
* modal is hidden
|
|
150
|
+
*/
|
|
151
|
+
restoreFocus: _propTypes2['default'].bool,
|
|
142
152
|
|
|
143
153
|
/**
|
|
144
154
|
* When `true` The modal will show itself.
|
|
145
155
|
*/
|
|
146
|
-
show:
|
|
156
|
+
show: _propTypes2['default'].bool,
|
|
147
157
|
|
|
148
158
|
/**
|
|
149
159
|
* A callback fired when the header closeButton or non-static backdrop is
|
|
150
160
|
* clicked. Required if either are specified.
|
|
151
161
|
*/
|
|
152
|
-
onHide:
|
|
162
|
+
onHide: _propTypes2['default'].func,
|
|
153
163
|
|
|
154
164
|
/**
|
|
155
165
|
* Callback fired before the Modal transitions in
|
|
156
166
|
*/
|
|
157
|
-
onEnter:
|
|
167
|
+
onEnter: _propTypes2['default'].func,
|
|
158
168
|
|
|
159
169
|
/**
|
|
160
170
|
* Callback fired as the Modal begins to transition in
|
|
161
171
|
*/
|
|
162
|
-
onEntering:
|
|
172
|
+
onEntering: _propTypes2['default'].func,
|
|
163
173
|
|
|
164
174
|
/**
|
|
165
175
|
* Callback fired after the Modal finishes transitioning in
|
|
166
176
|
*/
|
|
167
|
-
onEntered:
|
|
177
|
+
onEntered: _propTypes2['default'].func,
|
|
168
178
|
|
|
169
179
|
/**
|
|
170
180
|
* Callback fired right before the Modal transitions out
|
|
171
181
|
*/
|
|
172
|
-
onExit:
|
|
182
|
+
onExit: _propTypes2['default'].func,
|
|
173
183
|
|
|
174
184
|
/**
|
|
175
185
|
* Callback fired as the Modal begins to transition out
|
|
176
186
|
*/
|
|
177
|
-
onExiting:
|
|
187
|
+
onExiting: _propTypes2['default'].func,
|
|
178
188
|
|
|
179
189
|
/**
|
|
180
190
|
* Callback fired after the Modal finishes transitioning out
|
|
181
191
|
*/
|
|
182
|
-
onExited:
|
|
192
|
+
onExited: _propTypes2['default'].func,
|
|
183
193
|
|
|
184
194
|
/**
|
|
185
195
|
* @private
|
|
@@ -193,8 +203,8 @@ var defaultProps = (0, _extends3['default'])({}, _Modal2['default'].defaultProps
|
|
|
193
203
|
});
|
|
194
204
|
|
|
195
205
|
var childContextTypes = {
|
|
196
|
-
$bs_modal:
|
|
197
|
-
onHide:
|
|
206
|
+
$bs_modal: _propTypes2['default'].shape({
|
|
207
|
+
onHide: _propTypes2['default'].func
|
|
198
208
|
})
|
|
199
209
|
};
|
|
200
210
|
|
package/lib/ModalBody.js
CHANGED
|
@@ -30,10 +30,22 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _elementType = require('react-prop-types/lib/elementType');
|
|
34
|
+
|
|
35
|
+
var _elementType2 = _interopRequireDefault(_elementType);
|
|
36
|
+
|
|
33
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
34
38
|
|
|
35
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
36
40
|
|
|
41
|
+
var propTypes = {
|
|
42
|
+
componentClass: _elementType2['default']
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var defaultProps = {
|
|
46
|
+
componentClass: 'div'
|
|
47
|
+
};
|
|
48
|
+
|
|
37
49
|
var ModalBody = function (_React$Component) {
|
|
38
50
|
(0, _inherits3['default'])(ModalBody, _React$Component);
|
|
39
51
|
|
|
@@ -44,8 +56,9 @@ var ModalBody = function (_React$Component) {
|
|
|
44
56
|
|
|
45
57
|
ModalBody.prototype.render = function render() {
|
|
46
58
|
var _props = this.props,
|
|
59
|
+
Component = _props.componentClass,
|
|
47
60
|
className = _props.className,
|
|
48
|
-
props = (0, _objectWithoutProperties3['default'])(_props, ['className']);
|
|
61
|
+
props = (0, _objectWithoutProperties3['default'])(_props, ['componentClass', 'className']);
|
|
49
62
|
|
|
50
63
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
51
64
|
bsProps = _splitBsProps[0],
|
|
@@ -53,7 +66,7 @@ var ModalBody = function (_React$Component) {
|
|
|
53
66
|
|
|
54
67
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
55
68
|
|
|
56
|
-
return _react2['default'].createElement(
|
|
69
|
+
return _react2['default'].createElement(Component, (0, _extends3['default'])({}, elementProps, {
|
|
57
70
|
className: (0, _classnames2['default'])(className, classes)
|
|
58
71
|
}));
|
|
59
72
|
};
|
|
@@ -61,5 +74,8 @@ var ModalBody = function (_React$Component) {
|
|
|
61
74
|
return ModalBody;
|
|
62
75
|
}(_react2['default'].Component);
|
|
63
76
|
|
|
77
|
+
ModalBody.propTypes = propTypes;
|
|
78
|
+
ModalBody.defaultProps = defaultProps;
|
|
79
|
+
|
|
64
80
|
exports['default'] = (0, _bootstrapUtils.bsClass)('modal-body', ModalBody);
|
|
65
81
|
module.exports = exports['default'];
|
package/lib/ModalDialog.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
34
38
|
|
|
35
39
|
var _StyleConfig = require('./utils/StyleConfig');
|
|
@@ -40,7 +44,7 @@ var propTypes = {
|
|
|
40
44
|
/**
|
|
41
45
|
* A css class to apply to the Modal dialog DOM node.
|
|
42
46
|
*/
|
|
43
|
-
dialogClassName:
|
|
47
|
+
dialogClassName: _propTypes2['default'].string
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
var ModalDialog = function (_React$Component) {
|
package/lib/ModalFooter.js
CHANGED
|
@@ -30,10 +30,22 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _elementType = require('react-prop-types/lib/elementType');
|
|
34
|
+
|
|
35
|
+
var _elementType2 = _interopRequireDefault(_elementType);
|
|
36
|
+
|
|
33
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
34
38
|
|
|
35
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
36
40
|
|
|
41
|
+
var propTypes = {
|
|
42
|
+
componentClass: _elementType2['default']
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var defaultProps = {
|
|
46
|
+
componentClass: 'div'
|
|
47
|
+
};
|
|
48
|
+
|
|
37
49
|
var ModalFooter = function (_React$Component) {
|
|
38
50
|
(0, _inherits3['default'])(ModalFooter, _React$Component);
|
|
39
51
|
|
|
@@ -44,8 +56,9 @@ var ModalFooter = function (_React$Component) {
|
|
|
44
56
|
|
|
45
57
|
ModalFooter.prototype.render = function render() {
|
|
46
58
|
var _props = this.props,
|
|
59
|
+
Component = _props.componentClass,
|
|
47
60
|
className = _props.className,
|
|
48
|
-
props = (0, _objectWithoutProperties3['default'])(_props, ['className']);
|
|
61
|
+
props = (0, _objectWithoutProperties3['default'])(_props, ['componentClass', 'className']);
|
|
49
62
|
|
|
50
63
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
51
64
|
bsProps = _splitBsProps[0],
|
|
@@ -53,7 +66,7 @@ var ModalFooter = function (_React$Component) {
|
|
|
53
66
|
|
|
54
67
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
55
68
|
|
|
56
|
-
return _react2['default'].createElement(
|
|
69
|
+
return _react2['default'].createElement(Component, (0, _extends3['default'])({}, elementProps, {
|
|
57
70
|
className: (0, _classnames2['default'])(className, classes)
|
|
58
71
|
}));
|
|
59
72
|
};
|
|
@@ -61,5 +74,8 @@ var ModalFooter = function (_React$Component) {
|
|
|
61
74
|
return ModalFooter;
|
|
62
75
|
}(_react2['default'].Component);
|
|
63
76
|
|
|
77
|
+
ModalFooter.propTypes = propTypes;
|
|
78
|
+
ModalFooter.defaultProps = defaultProps;
|
|
79
|
+
|
|
64
80
|
exports['default'] = (0, _bootstrapUtils.bsClass)('modal-footer', ModalFooter);
|
|
65
81
|
module.exports = exports['default'];
|
package/lib/ModalHeader.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
34
38
|
|
|
35
39
|
var _createChainedFunction = require('./utils/createChainedFunction');
|
|
@@ -46,19 +50,19 @@ var propTypes = {
|
|
|
46
50
|
* button. It is used for Assistive Technology when the label text is not
|
|
47
51
|
* readable.
|
|
48
52
|
*/
|
|
49
|
-
'aria-label':
|
|
53
|
+
'aria-label': _propTypes2['default'].string,
|
|
50
54
|
|
|
51
55
|
/**
|
|
52
56
|
* Specify whether the Component should contain a close button
|
|
53
57
|
*/
|
|
54
|
-
closeButton:
|
|
58
|
+
closeButton: _propTypes2['default'].bool,
|
|
55
59
|
|
|
56
60
|
/**
|
|
57
61
|
* A Callback fired when the close button is clicked. If used directly inside
|
|
58
62
|
* a Modal component, the onHide will automatically be propagated up to the
|
|
59
63
|
* parent Modal `onHide`.
|
|
60
64
|
*/
|
|
61
|
-
onHide:
|
|
65
|
+
onHide: _propTypes2['default'].func
|
|
62
66
|
};
|
|
63
67
|
|
|
64
68
|
var defaultProps = {
|
|
@@ -67,8 +71,8 @@ var defaultProps = {
|
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
var contextTypes = {
|
|
70
|
-
$bs_modal:
|
|
71
|
-
onHide:
|
|
74
|
+
$bs_modal: _propTypes2['default'].shape({
|
|
75
|
+
onHide: _propTypes2['default'].func
|
|
72
76
|
})
|
|
73
77
|
};
|
|
74
78
|
|
|
@@ -109,7 +113,7 @@ var ModalHeader = function (_React$Component) {
|
|
|
109
113
|
type: 'button',
|
|
110
114
|
className: 'close',
|
|
111
115
|
'aria-label': label,
|
|
112
|
-
onClick: (0, _createChainedFunction2['default'])(modal.onHide, onHide)
|
|
116
|
+
onClick: (0, _createChainedFunction2['default'])(modal && modal.onHide, onHide)
|
|
113
117
|
},
|
|
114
118
|
_react2['default'].createElement(
|
|
115
119
|
'span',
|
package/lib/ModalTitle.js
CHANGED
|
@@ -30,10 +30,22 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _elementType = require('react-prop-types/lib/elementType');
|
|
34
|
+
|
|
35
|
+
var _elementType2 = _interopRequireDefault(_elementType);
|
|
36
|
+
|
|
33
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
34
38
|
|
|
35
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
36
40
|
|
|
41
|
+
var propTypes = {
|
|
42
|
+
componentClass: _elementType2['default']
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var defaultProps = {
|
|
46
|
+
componentClass: 'h4'
|
|
47
|
+
};
|
|
48
|
+
|
|
37
49
|
var ModalTitle = function (_React$Component) {
|
|
38
50
|
(0, _inherits3['default'])(ModalTitle, _React$Component);
|
|
39
51
|
|
|
@@ -44,8 +56,9 @@ var ModalTitle = function (_React$Component) {
|
|
|
44
56
|
|
|
45
57
|
ModalTitle.prototype.render = function render() {
|
|
46
58
|
var _props = this.props,
|
|
59
|
+
Component = _props.componentClass,
|
|
47
60
|
className = _props.className,
|
|
48
|
-
props = (0, _objectWithoutProperties3['default'])(_props, ['className']);
|
|
61
|
+
props = (0, _objectWithoutProperties3['default'])(_props, ['componentClass', 'className']);
|
|
49
62
|
|
|
50
63
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
51
64
|
bsProps = _splitBsProps[0],
|
|
@@ -53,7 +66,7 @@ var ModalTitle = function (_React$Component) {
|
|
|
53
66
|
|
|
54
67
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
55
68
|
|
|
56
|
-
return _react2['default'].createElement(
|
|
69
|
+
return _react2['default'].createElement(Component, (0, _extends3['default'])({}, elementProps, {
|
|
57
70
|
className: (0, _classnames2['default'])(className, classes)
|
|
58
71
|
}));
|
|
59
72
|
};
|
|
@@ -61,5 +74,8 @@ var ModalTitle = function (_React$Component) {
|
|
|
61
74
|
return ModalTitle;
|
|
62
75
|
}(_react2['default'].Component);
|
|
63
76
|
|
|
77
|
+
ModalTitle.propTypes = propTypes;
|
|
78
|
+
ModalTitle.defaultProps = defaultProps;
|
|
79
|
+
|
|
64
80
|
exports['default'] = (0, _bootstrapUtils.bsClass)('modal-title', ModalTitle);
|
|
65
81
|
module.exports = exports['default'];
|
package/lib/Nav.js
CHANGED
|
@@ -34,6 +34,10 @@ var _react = require('react');
|
|
|
34
34
|
|
|
35
35
|
var _react2 = _interopRequireDefault(_react);
|
|
36
36
|
|
|
37
|
+
var _propTypes = require('prop-types');
|
|
38
|
+
|
|
39
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
40
|
+
|
|
37
41
|
var _reactDom = require('react-dom');
|
|
38
42
|
|
|
39
43
|
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
@@ -70,19 +74,19 @@ var propTypes = {
|
|
|
70
74
|
* Marks the NavItem with a matching `eventKey` as active. Has a
|
|
71
75
|
* higher precedence over `activeHref`.
|
|
72
76
|
*/
|
|
73
|
-
activeKey:
|
|
77
|
+
activeKey: _propTypes2['default'].any,
|
|
74
78
|
|
|
75
79
|
/**
|
|
76
80
|
* Marks the child NavItem with a matching `href` prop as active.
|
|
77
81
|
*/
|
|
78
|
-
activeHref:
|
|
82
|
+
activeHref: _propTypes2['default'].string,
|
|
79
83
|
|
|
80
84
|
/**
|
|
81
85
|
* NavItems are be positioned vertically.
|
|
82
86
|
*/
|
|
83
|
-
stacked:
|
|
87
|
+
stacked: _propTypes2['default'].bool,
|
|
84
88
|
|
|
85
|
-
justified: (0, _all2['default'])(
|
|
89
|
+
justified: (0, _all2['default'])(_propTypes2['default'].bool, function (_ref) {
|
|
86
90
|
var justified = _ref.justified,
|
|
87
91
|
navbar = _ref.navbar;
|
|
88
92
|
return justified && navbar ? Error('justified navbar `Nav`s are not supported') : null;
|
|
@@ -98,7 +102,7 @@ var propTypes = {
|
|
|
98
102
|
* )
|
|
99
103
|
* ```
|
|
100
104
|
*/
|
|
101
|
-
onSelect:
|
|
105
|
+
onSelect: _propTypes2['default'].func,
|
|
102
106
|
|
|
103
107
|
/**
|
|
104
108
|
* ARIA role for the Nav, in the context of a TabContainer, the default will
|
|
@@ -108,25 +112,25 @@ var propTypes = {
|
|
|
108
112
|
* the ARIA authoring practices for tabs:
|
|
109
113
|
* https://www.w3.org/TR/2013/WD-wai-aria-practices-20130307/#tabpanel
|
|
110
114
|
*/
|
|
111
|
-
role:
|
|
115
|
+
role: _propTypes2['default'].string,
|
|
112
116
|
|
|
113
117
|
/**
|
|
114
118
|
* Apply styling an alignment for use in a Navbar. This prop will be set
|
|
115
119
|
* automatically when the Nav is used inside a Navbar.
|
|
116
120
|
*/
|
|
117
|
-
navbar:
|
|
121
|
+
navbar: _propTypes2['default'].bool,
|
|
118
122
|
|
|
119
123
|
/**
|
|
120
124
|
* Float the Nav to the right. When `navbar` is `true` the appropriate
|
|
121
125
|
* contextual classes are added as well.
|
|
122
126
|
*/
|
|
123
|
-
pullRight:
|
|
127
|
+
pullRight: _propTypes2['default'].bool,
|
|
124
128
|
|
|
125
129
|
/**
|
|
126
130
|
* Float the Nav to the left. When `navbar` is `true` the appropriate
|
|
127
131
|
* contextual classes are added as well.
|
|
128
132
|
*/
|
|
129
|
-
pullLeft:
|
|
133
|
+
pullLeft: _propTypes2['default'].bool
|
|
130
134
|
};
|
|
131
135
|
|
|
132
136
|
var defaultProps = {
|
|
@@ -137,16 +141,16 @@ var defaultProps = {
|
|
|
137
141
|
};
|
|
138
142
|
|
|
139
143
|
var contextTypes = {
|
|
140
|
-
$bs_navbar:
|
|
141
|
-
bsClass:
|
|
142
|
-
onSelect:
|
|
144
|
+
$bs_navbar: _propTypes2['default'].shape({
|
|
145
|
+
bsClass: _propTypes2['default'].string,
|
|
146
|
+
onSelect: _propTypes2['default'].func
|
|
143
147
|
}),
|
|
144
148
|
|
|
145
|
-
$bs_tabContainer:
|
|
146
|
-
activeKey:
|
|
147
|
-
onSelect:
|
|
148
|
-
getTabId:
|
|
149
|
-
getPaneId:
|
|
149
|
+
$bs_tabContainer: _propTypes2['default'].shape({
|
|
150
|
+
activeKey: _propTypes2['default'].any,
|
|
151
|
+
onSelect: _propTypes2['default'].func.isRequired,
|
|
152
|
+
getTabId: _propTypes2['default'].func.isRequired,
|
|
153
|
+
getPaneId: _propTypes2['default'].func.isRequired
|
|
150
154
|
})
|
|
151
155
|
};
|
|
152
156
|
|
|
@@ -209,7 +213,7 @@ var Nav = function (_React$Component) {
|
|
|
209
213
|
|
|
210
214
|
event.preventDefault();
|
|
211
215
|
|
|
212
|
-
if (onSelect && nextActiveChild && nextActiveChild.props.eventKey) {
|
|
216
|
+
if (onSelect && nextActiveChild && nextActiveChild.props.eventKey != null) {
|
|
213
217
|
onSelect(nextActiveChild.props.eventKey);
|
|
214
218
|
}
|
|
215
219
|
|
|
@@ -222,7 +226,7 @@ var Nav = function (_React$Component) {
|
|
|
222
226
|
var children = this.props.children;
|
|
223
227
|
|
|
224
228
|
var validChildren = children.filter(function (child) {
|
|
225
|
-
return child.props.eventKey && !child.props.disabled;
|
|
229
|
+
return child.props.eventKey != null && !child.props.disabled;
|
|
226
230
|
});
|
|
227
231
|
|
|
228
232
|
var _getActiveProps2 = this.getActiveProps(),
|
package/lib/NavDropdown.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _Dropdown = require('./Dropdown');
|
|
34
38
|
|
|
35
39
|
var _Dropdown2 = _interopRequireDefault(_Dropdown);
|
|
@@ -47,15 +51,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd
|
|
|
47
51
|
var propTypes = (0, _extends3['default'])({}, _Dropdown2['default'].propTypes, {
|
|
48
52
|
|
|
49
53
|
// Toggle props.
|
|
50
|
-
title:
|
|
51
|
-
noCaret:
|
|
52
|
-
active:
|
|
54
|
+
title: _propTypes2['default'].node.isRequired,
|
|
55
|
+
noCaret: _propTypes2['default'].bool,
|
|
56
|
+
active: _propTypes2['default'].bool,
|
|
53
57
|
|
|
54
58
|
// Override generated docs from <Dropdown>.
|
|
55
59
|
/**
|
|
56
60
|
* @private
|
|
57
61
|
*/
|
|
58
|
-
children:
|
|
62
|
+
children: _propTypes2['default'].node
|
|
59
63
|
});
|
|
60
64
|
|
|
61
65
|
var NavDropdown = function (_React$Component) {
|
package/lib/NavItem.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _SafeAnchor = require('./SafeAnchor');
|
|
34
38
|
|
|
35
39
|
var _SafeAnchor2 = _interopRequireDefault(_SafeAnchor);
|
|
@@ -41,13 +45,13 @@ var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
|
|
41
45
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
42
46
|
|
|
43
47
|
var propTypes = {
|
|
44
|
-
active:
|
|
45
|
-
disabled:
|
|
46
|
-
role:
|
|
47
|
-
href:
|
|
48
|
-
onClick:
|
|
49
|
-
onSelect:
|
|
50
|
-
eventKey:
|
|
48
|
+
active: _propTypes2['default'].bool,
|
|
49
|
+
disabled: _propTypes2['default'].bool,
|
|
50
|
+
role: _propTypes2['default'].string,
|
|
51
|
+
href: _propTypes2['default'].string,
|
|
52
|
+
onClick: _propTypes2['default'].func,
|
|
53
|
+
onSelect: _propTypes2['default'].func,
|
|
54
|
+
eventKey: _propTypes2['default'].any
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
var defaultProps = {
|
package/lib/Navbar.js
CHANGED
|
@@ -30,6 +30,10 @@ var _react = require('react');
|
|
|
30
30
|
|
|
31
31
|
var _react2 = _interopRequireDefault(_react);
|
|
32
32
|
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
33
37
|
var _elementType = require('react-prop-types/lib/elementType');
|
|
34
38
|
|
|
35
39
|
var _elementType2 = _interopRequireDefault(_elementType);
|
|
@@ -68,33 +72,30 @@ var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
|
|
|
68
72
|
|
|
69
73
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
70
74
|
|
|
71
|
-
// TODO: Remove this pragma once we upgrade eslint-config-airbnb.
|
|
72
|
-
/* eslint-disable react/no-multi-comp */
|
|
73
|
-
|
|
74
75
|
var propTypes = {
|
|
75
76
|
/**
|
|
76
77
|
* Create a fixed navbar along the top of the screen, that scrolls with the
|
|
77
78
|
* page
|
|
78
79
|
*/
|
|
79
|
-
fixedTop:
|
|
80
|
+
fixedTop: _propTypes2['default'].bool,
|
|
80
81
|
/**
|
|
81
82
|
* Create a fixed navbar along the bottom of the screen, that scrolls with
|
|
82
83
|
* the page
|
|
83
84
|
*/
|
|
84
|
-
fixedBottom:
|
|
85
|
+
fixedBottom: _propTypes2['default'].bool,
|
|
85
86
|
/**
|
|
86
87
|
* Create a full-width navbar that scrolls away with the page
|
|
87
88
|
*/
|
|
88
|
-
staticTop:
|
|
89
|
+
staticTop: _propTypes2['default'].bool,
|
|
89
90
|
/**
|
|
90
91
|
* An alternative dark visual style for the Navbar
|
|
91
92
|
*/
|
|
92
|
-
inverse:
|
|
93
|
+
inverse: _propTypes2['default'].bool,
|
|
93
94
|
/**
|
|
94
95
|
* Allow the Navbar to fluidly adjust to the page or container width, instead
|
|
95
96
|
* of at the predefined screen breakpoints
|
|
96
97
|
*/
|
|
97
|
-
fluid:
|
|
98
|
+
fluid: _propTypes2['default'].bool,
|
|
98
99
|
|
|
99
100
|
/**
|
|
100
101
|
* Set a custom element for this component.
|
|
@@ -107,7 +108,7 @@ var propTypes = {
|
|
|
107
108
|
*
|
|
108
109
|
* @controllable navExpanded
|
|
109
110
|
*/
|
|
110
|
-
onToggle:
|
|
111
|
+
onToggle: _propTypes2['default'].func,
|
|
111
112
|
/**
|
|
112
113
|
* A callback fired when a descendant of a child `<Nav>` is selected. Should
|
|
113
114
|
* be used to execute complex closing or other miscellaneous actions desired
|
|
@@ -129,7 +130,7 @@ var propTypes = {
|
|
|
129
130
|
* ensure that you are setting `expanded` to false and not *toggling* between
|
|
130
131
|
* true and false.
|
|
131
132
|
*/
|
|
132
|
-
onSelect:
|
|
133
|
+
onSelect: _propTypes2['default'].func,
|
|
133
134
|
/**
|
|
134
135
|
* Sets `expanded` to `false` after the onSelect event of a descendant of a
|
|
135
136
|
* child `<Nav>`. Does nothing if no `<Nav>` or `<Nav>` descendants exist.
|
|
@@ -137,16 +138,17 @@ var propTypes = {
|
|
|
137
138
|
* The onSelect callback should be used instead for more complex operations
|
|
138
139
|
* that need to be executed after the `select` event of `<Nav>` descendants.
|
|
139
140
|
*/
|
|
140
|
-
collapseOnSelect:
|
|
141
|
+
collapseOnSelect: _propTypes2['default'].bool,
|
|
141
142
|
/**
|
|
142
143
|
* Explicitly set the visiblity of the navbar body
|
|
143
144
|
*
|
|
144
145
|
* @controllable onToggle
|
|
145
146
|
*/
|
|
146
|
-
expanded:
|
|
147
|
+
expanded: _propTypes2['default'].bool,
|
|
147
148
|
|
|
148
|
-
role:
|
|
149
|
-
};
|
|
149
|
+
role: _propTypes2['default'].string
|
|
150
|
+
}; // TODO: Remove this pragma once we upgrade eslint-config-airbnb.
|
|
151
|
+
/* eslint-disable react/no-multi-comp */
|
|
150
152
|
|
|
151
153
|
var defaultProps = {
|
|
152
154
|
componentClass: 'nav',
|
|
@@ -159,11 +161,11 @@ var defaultProps = {
|
|
|
159
161
|
};
|
|
160
162
|
|
|
161
163
|
var childContextTypes = {
|
|
162
|
-
$bs_navbar:
|
|
163
|
-
bsClass:
|
|
164
|
-
expanded:
|
|
165
|
-
onToggle:
|
|
166
|
-
onSelect:
|
|
164
|
+
$bs_navbar: _propTypes2['default'].shape({
|
|
165
|
+
bsClass: _propTypes2['default'].string,
|
|
166
|
+
expanded: _propTypes2['default'].bool,
|
|
167
|
+
onToggle: _propTypes2['default'].func.isRequired,
|
|
168
|
+
onSelect: _propTypes2['default'].func
|
|
167
169
|
})
|
|
168
170
|
};
|
|
169
171
|
|
|
@@ -277,13 +279,13 @@ var UncontrollableNavbar = (0, _uncontrollable2['default'])(Navbar, { expanded:
|
|
|
277
279
|
|
|
278
280
|
function createSimpleWrapper(tag, suffix, displayName) {
|
|
279
281
|
var Wrapper = function Wrapper(_ref, _ref2) {
|
|
282
|
+
var _ref2$$bs_navbar = _ref2.$bs_navbar,
|
|
283
|
+
navbarProps = _ref2$$bs_navbar === undefined ? { bsClass: 'navbar' } : _ref2$$bs_navbar;
|
|
280
284
|
var Component = _ref.componentClass,
|
|
281
285
|
className = _ref.className,
|
|
282
286
|
pullRight = _ref.pullRight,
|
|
283
287
|
pullLeft = _ref.pullLeft,
|
|
284
288
|
props = (0, _objectWithoutProperties3['default'])(_ref, ['componentClass', 'className', 'pullRight', 'pullLeft']);
|
|
285
|
-
var _ref2$$bs_navbar = _ref2.$bs_navbar,
|
|
286
|
-
navbarProps = _ref2$$bs_navbar === undefined ? { bsClass: 'navbar' } : _ref2$$bs_navbar;
|
|
287
289
|
return _react2['default'].createElement(Component, (0, _extends4['default'])({}, props, {
|
|
288
290
|
className: (0, _classnames2['default'])(className, (0, _bootstrapUtils.prefix)(navbarProps, suffix), pullRight && (0, _bootstrapUtils.prefix)(navbarProps, 'right'), pullLeft && (0, _bootstrapUtils.prefix)(navbarProps, 'left'))
|
|
289
291
|
}));
|
|
@@ -293,8 +295,8 @@ function createSimpleWrapper(tag, suffix, displayName) {
|
|
|
293
295
|
|
|
294
296
|
Wrapper.propTypes = {
|
|
295
297
|
componentClass: _elementType2['default'],
|
|
296
|
-
pullRight:
|
|
297
|
-
pullLeft:
|
|
298
|
+
pullRight: _propTypes2['default'].bool,
|
|
299
|
+
pullLeft: _propTypes2['default'].bool
|
|
298
300
|
};
|
|
299
301
|
|
|
300
302
|
Wrapper.defaultProps = {
|
|
@@ -304,8 +306,8 @@ function createSimpleWrapper(tag, suffix, displayName) {
|
|
|
304
306
|
};
|
|
305
307
|
|
|
306
308
|
Wrapper.contextTypes = {
|
|
307
|
-
$bs_navbar:
|
|
308
|
-
bsClass:
|
|
309
|
+
$bs_navbar: _propTypes2['default'].shape({
|
|
310
|
+
bsClass: _propTypes2['default'].string
|
|
309
311
|
})
|
|
310
312
|
};
|
|
311
313
|
|