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/es/MenuItem.js
CHANGED
|
@@ -5,6 +5,7 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
import all from 'react-prop-types/lib/all';
|
|
9
10
|
|
|
10
11
|
import SafeAnchor from './SafeAnchor';
|
|
@@ -15,18 +16,18 @@ var propTypes = {
|
|
|
15
16
|
/**
|
|
16
17
|
* Highlight the menu item as active.
|
|
17
18
|
*/
|
|
18
|
-
active:
|
|
19
|
+
active: PropTypes.bool,
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Disable the menu item, making it unselectable.
|
|
22
23
|
*/
|
|
23
|
-
disabled:
|
|
24
|
+
disabled: PropTypes.bool,
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Styles the menu item as a horizontal rule, providing visual separation between
|
|
27
28
|
* groups of menu items.
|
|
28
29
|
*/
|
|
29
|
-
divider: all(
|
|
30
|
+
divider: all(PropTypes.bool, function (_ref) {
|
|
30
31
|
var divider = _ref.divider,
|
|
31
32
|
children = _ref.children;
|
|
32
33
|
return divider && children ? new Error('Children will not be rendered for dividers') : null;
|
|
@@ -35,22 +36,22 @@ var propTypes = {
|
|
|
35
36
|
/**
|
|
36
37
|
* Value passed to the `onSelect` handler, useful for identifying the selected menu item.
|
|
37
38
|
*/
|
|
38
|
-
eventKey:
|
|
39
|
+
eventKey: PropTypes.any,
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
42
|
* Styles the menu item as a header label, useful for describing a group of menu items.
|
|
42
43
|
*/
|
|
43
|
-
header:
|
|
44
|
+
header: PropTypes.bool,
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* HTML `href` attribute corresponding to `a.href`.
|
|
47
48
|
*/
|
|
48
|
-
href:
|
|
49
|
+
href: PropTypes.string,
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* Callback fired when the menu item is clicked.
|
|
52
53
|
*/
|
|
53
|
-
onClick:
|
|
54
|
+
onClick: PropTypes.func,
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
57
|
* Callback fired when the menu item is selected.
|
|
@@ -59,7 +60,7 @@ var propTypes = {
|
|
|
59
60
|
* (eventKey: any, event: Object) => any
|
|
60
61
|
* ```
|
|
61
62
|
*/
|
|
62
|
-
onSelect:
|
|
63
|
+
onSelect: PropTypes.func
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
var defaultProps = {
|
package/es/Modal.js
CHANGED
|
@@ -9,6 +9,7 @@ import ownerDocument from 'dom-helpers/ownerDocument';
|
|
|
9
9
|
import canUseDOM from 'dom-helpers/util/inDOM';
|
|
10
10
|
import getScrollbarSize from 'dom-helpers/util/scrollbarSize';
|
|
11
11
|
import React from 'react';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
12
13
|
import ReactDOM from 'react-dom';
|
|
13
14
|
import BaseModal from 'react-overlays/lib/Modal';
|
|
14
15
|
import isOverflowing from 'react-overlays/lib/utils/isOverflowing';
|
|
@@ -31,17 +32,17 @@ var propTypes = _extends({}, BaseModal.propTypes, ModalDialog.propTypes, {
|
|
|
31
32
|
* Include a backdrop component. Specify 'static' for a backdrop that doesn't
|
|
32
33
|
* trigger an "onHide" when clicked.
|
|
33
34
|
*/
|
|
34
|
-
backdrop:
|
|
35
|
+
backdrop: PropTypes.oneOf(['static', true, false]),
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* Close the modal when escape key is pressed
|
|
38
39
|
*/
|
|
39
|
-
keyboard:
|
|
40
|
+
keyboard: PropTypes.bool,
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
43
|
* Open and close the Modal with a slide and fade animation.
|
|
43
44
|
*/
|
|
44
|
-
animation:
|
|
45
|
+
animation: PropTypes.bool,
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
48
|
* A Component type that provides the modal content Markup. This is a useful
|
|
@@ -56,55 +57,61 @@ var propTypes = _extends({}, BaseModal.propTypes, ModalDialog.propTypes, {
|
|
|
56
57
|
* Generally this should never be set to false as it makes the Modal less
|
|
57
58
|
* accessible to assistive technologies, like screen-readers.
|
|
58
59
|
*/
|
|
59
|
-
autoFocus:
|
|
60
|
+
autoFocus: PropTypes.bool,
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
63
|
* When `true` The modal will prevent focus from leaving the Modal while
|
|
63
64
|
* open. Consider leaving the default value here, as it is necessary to make
|
|
64
65
|
* the Modal work well with assistive technologies, such as screen readers.
|
|
65
66
|
*/
|
|
66
|
-
enforceFocus:
|
|
67
|
+
enforceFocus: PropTypes.bool,
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* When `true` The modal will restore focus to previously focused element once
|
|
71
|
+
* modal is hidden
|
|
72
|
+
*/
|
|
73
|
+
restoreFocus: PropTypes.bool,
|
|
67
74
|
|
|
68
75
|
/**
|
|
69
76
|
* When `true` The modal will show itself.
|
|
70
77
|
*/
|
|
71
|
-
show:
|
|
78
|
+
show: PropTypes.bool,
|
|
72
79
|
|
|
73
80
|
/**
|
|
74
81
|
* A callback fired when the header closeButton or non-static backdrop is
|
|
75
82
|
* clicked. Required if either are specified.
|
|
76
83
|
*/
|
|
77
|
-
onHide:
|
|
84
|
+
onHide: PropTypes.func,
|
|
78
85
|
|
|
79
86
|
/**
|
|
80
87
|
* Callback fired before the Modal transitions in
|
|
81
88
|
*/
|
|
82
|
-
onEnter:
|
|
89
|
+
onEnter: PropTypes.func,
|
|
83
90
|
|
|
84
91
|
/**
|
|
85
92
|
* Callback fired as the Modal begins to transition in
|
|
86
93
|
*/
|
|
87
|
-
onEntering:
|
|
94
|
+
onEntering: PropTypes.func,
|
|
88
95
|
|
|
89
96
|
/**
|
|
90
97
|
* Callback fired after the Modal finishes transitioning in
|
|
91
98
|
*/
|
|
92
|
-
onEntered:
|
|
99
|
+
onEntered: PropTypes.func,
|
|
93
100
|
|
|
94
101
|
/**
|
|
95
102
|
* Callback fired right before the Modal transitions out
|
|
96
103
|
*/
|
|
97
|
-
onExit:
|
|
104
|
+
onExit: PropTypes.func,
|
|
98
105
|
|
|
99
106
|
/**
|
|
100
107
|
* Callback fired as the Modal begins to transition out
|
|
101
108
|
*/
|
|
102
|
-
onExiting:
|
|
109
|
+
onExiting: PropTypes.func,
|
|
103
110
|
|
|
104
111
|
/**
|
|
105
112
|
* Callback fired after the Modal finishes transitioning out
|
|
106
113
|
*/
|
|
107
|
-
onExited:
|
|
114
|
+
onExited: PropTypes.func,
|
|
108
115
|
|
|
109
116
|
/**
|
|
110
117
|
* @private
|
|
@@ -118,8 +125,8 @@ var defaultProps = _extends({}, BaseModal.defaultProps, {
|
|
|
118
125
|
});
|
|
119
126
|
|
|
120
127
|
var childContextTypes = {
|
|
121
|
-
$bs_modal:
|
|
122
|
-
onHide:
|
|
128
|
+
$bs_modal: PropTypes.shape({
|
|
129
|
+
onHide: PropTypes.func
|
|
123
130
|
})
|
|
124
131
|
};
|
|
125
132
|
|
package/es/ModalBody.js
CHANGED
|
@@ -5,9 +5,18 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import elementType from 'react-prop-types/lib/elementType';
|
|
8
9
|
|
|
9
10
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
10
11
|
|
|
12
|
+
var propTypes = {
|
|
13
|
+
componentClass: elementType
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var defaultProps = {
|
|
17
|
+
componentClass: 'div'
|
|
18
|
+
};
|
|
19
|
+
|
|
11
20
|
var ModalBody = function (_React$Component) {
|
|
12
21
|
_inherits(ModalBody, _React$Component);
|
|
13
22
|
|
|
@@ -19,8 +28,9 @@ var ModalBody = function (_React$Component) {
|
|
|
19
28
|
|
|
20
29
|
ModalBody.prototype.render = function render() {
|
|
21
30
|
var _props = this.props,
|
|
31
|
+
Component = _props.componentClass,
|
|
22
32
|
className = _props.className,
|
|
23
|
-
props = _objectWithoutProperties(_props, ['className']);
|
|
33
|
+
props = _objectWithoutProperties(_props, ['componentClass', 'className']);
|
|
24
34
|
|
|
25
35
|
var _splitBsProps = splitBsProps(props),
|
|
26
36
|
bsProps = _splitBsProps[0],
|
|
@@ -28,7 +38,7 @@ var ModalBody = function (_React$Component) {
|
|
|
28
38
|
|
|
29
39
|
var classes = getClassSet(bsProps);
|
|
30
40
|
|
|
31
|
-
return React.createElement(
|
|
41
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
32
42
|
className: classNames(className, classes)
|
|
33
43
|
}));
|
|
34
44
|
};
|
|
@@ -36,4 +46,7 @@ var ModalBody = function (_React$Component) {
|
|
|
36
46
|
return ModalBody;
|
|
37
47
|
}(React.Component);
|
|
38
48
|
|
|
49
|
+
ModalBody.propTypes = propTypes;
|
|
50
|
+
ModalBody.defaultProps = defaultProps;
|
|
51
|
+
|
|
39
52
|
export default bsClass('modal-body', ModalBody);
|
package/es/ModalDialog.js
CHANGED
|
@@ -5,6 +5,7 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
|
|
9
10
|
import { bsClass, bsSizes, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
10
11
|
import { Size } from './utils/StyleConfig';
|
|
@@ -13,7 +14,7 @@ var propTypes = {
|
|
|
13
14
|
/**
|
|
14
15
|
* A css class to apply to the Modal dialog DOM node.
|
|
15
16
|
*/
|
|
16
|
-
dialogClassName:
|
|
17
|
+
dialogClassName: PropTypes.string
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
var ModalDialog = function (_React$Component) {
|
package/es/ModalFooter.js
CHANGED
|
@@ -5,9 +5,18 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import elementType from 'react-prop-types/lib/elementType';
|
|
8
9
|
|
|
9
10
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
10
11
|
|
|
12
|
+
var propTypes = {
|
|
13
|
+
componentClass: elementType
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var defaultProps = {
|
|
17
|
+
componentClass: 'div'
|
|
18
|
+
};
|
|
19
|
+
|
|
11
20
|
var ModalFooter = function (_React$Component) {
|
|
12
21
|
_inherits(ModalFooter, _React$Component);
|
|
13
22
|
|
|
@@ -19,8 +28,9 @@ var ModalFooter = function (_React$Component) {
|
|
|
19
28
|
|
|
20
29
|
ModalFooter.prototype.render = function render() {
|
|
21
30
|
var _props = this.props,
|
|
31
|
+
Component = _props.componentClass,
|
|
22
32
|
className = _props.className,
|
|
23
|
-
props = _objectWithoutProperties(_props, ['className']);
|
|
33
|
+
props = _objectWithoutProperties(_props, ['componentClass', 'className']);
|
|
24
34
|
|
|
25
35
|
var _splitBsProps = splitBsProps(props),
|
|
26
36
|
bsProps = _splitBsProps[0],
|
|
@@ -28,7 +38,7 @@ var ModalFooter = function (_React$Component) {
|
|
|
28
38
|
|
|
29
39
|
var classes = getClassSet(bsProps);
|
|
30
40
|
|
|
31
|
-
return React.createElement(
|
|
41
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
32
42
|
className: classNames(className, classes)
|
|
33
43
|
}));
|
|
34
44
|
};
|
|
@@ -36,4 +46,7 @@ var ModalFooter = function (_React$Component) {
|
|
|
36
46
|
return ModalFooter;
|
|
37
47
|
}(React.Component);
|
|
38
48
|
|
|
49
|
+
ModalFooter.propTypes = propTypes;
|
|
50
|
+
ModalFooter.defaultProps = defaultProps;
|
|
51
|
+
|
|
39
52
|
export default bsClass('modal-footer', ModalFooter);
|
package/es/ModalHeader.js
CHANGED
|
@@ -5,6 +5,7 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
|
|
9
10
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
10
11
|
import createChainedFunction from './utils/createChainedFunction';
|
|
@@ -17,19 +18,19 @@ var propTypes = {
|
|
|
17
18
|
* button. It is used for Assistive Technology when the label text is not
|
|
18
19
|
* readable.
|
|
19
20
|
*/
|
|
20
|
-
'aria-label':
|
|
21
|
+
'aria-label': PropTypes.string,
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Specify whether the Component should contain a close button
|
|
24
25
|
*/
|
|
25
|
-
closeButton:
|
|
26
|
+
closeButton: PropTypes.bool,
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* A Callback fired when the close button is clicked. If used directly inside
|
|
29
30
|
* a Modal component, the onHide will automatically be propagated up to the
|
|
30
31
|
* parent Modal `onHide`.
|
|
31
32
|
*/
|
|
32
|
-
onHide:
|
|
33
|
+
onHide: PropTypes.func
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
var defaultProps = {
|
|
@@ -38,8 +39,8 @@ var defaultProps = {
|
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
var contextTypes = {
|
|
41
|
-
$bs_modal:
|
|
42
|
-
onHide:
|
|
42
|
+
$bs_modal: PropTypes.shape({
|
|
43
|
+
onHide: PropTypes.func
|
|
43
44
|
})
|
|
44
45
|
};
|
|
45
46
|
|
|
@@ -80,7 +81,7 @@ var ModalHeader = function (_React$Component) {
|
|
|
80
81
|
type: 'button',
|
|
81
82
|
className: 'close',
|
|
82
83
|
'aria-label': label,
|
|
83
|
-
onClick: createChainedFunction(modal.onHide, onHide)
|
|
84
|
+
onClick: createChainedFunction(modal && modal.onHide, onHide)
|
|
84
85
|
},
|
|
85
86
|
React.createElement(
|
|
86
87
|
'span',
|
package/es/ModalTitle.js
CHANGED
|
@@ -5,9 +5,18 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import elementType from 'react-prop-types/lib/elementType';
|
|
8
9
|
|
|
9
10
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
10
11
|
|
|
12
|
+
var propTypes = {
|
|
13
|
+
componentClass: elementType
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var defaultProps = {
|
|
17
|
+
componentClass: 'h4'
|
|
18
|
+
};
|
|
19
|
+
|
|
11
20
|
var ModalTitle = function (_React$Component) {
|
|
12
21
|
_inherits(ModalTitle, _React$Component);
|
|
13
22
|
|
|
@@ -19,8 +28,9 @@ var ModalTitle = function (_React$Component) {
|
|
|
19
28
|
|
|
20
29
|
ModalTitle.prototype.render = function render() {
|
|
21
30
|
var _props = this.props,
|
|
31
|
+
Component = _props.componentClass,
|
|
22
32
|
className = _props.className,
|
|
23
|
-
props = _objectWithoutProperties(_props, ['className']);
|
|
33
|
+
props = _objectWithoutProperties(_props, ['componentClass', 'className']);
|
|
24
34
|
|
|
25
35
|
var _splitBsProps = splitBsProps(props),
|
|
26
36
|
bsProps = _splitBsProps[0],
|
|
@@ -28,7 +38,7 @@ var ModalTitle = function (_React$Component) {
|
|
|
28
38
|
|
|
29
39
|
var classes = getClassSet(bsProps);
|
|
30
40
|
|
|
31
|
-
return React.createElement(
|
|
41
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
32
42
|
className: classNames(className, classes)
|
|
33
43
|
}));
|
|
34
44
|
};
|
|
@@ -36,4 +46,7 @@ var ModalTitle = function (_React$Component) {
|
|
|
36
46
|
return ModalTitle;
|
|
37
47
|
}(React.Component);
|
|
38
48
|
|
|
49
|
+
ModalTitle.propTypes = propTypes;
|
|
50
|
+
ModalTitle.defaultProps = defaultProps;
|
|
51
|
+
|
|
39
52
|
export default bsClass('modal-title', ModalTitle);
|
package/es/Nav.js
CHANGED
|
@@ -6,6 +6,7 @@ import _inherits from 'babel-runtime/helpers/inherits';
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import keycode from 'keycode';
|
|
8
8
|
import React, { cloneElement } from 'react';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
9
10
|
import ReactDOM from 'react-dom';
|
|
10
11
|
import all from 'react-prop-types/lib/all';
|
|
11
12
|
import warning from 'warning';
|
|
@@ -26,19 +27,19 @@ var propTypes = {
|
|
|
26
27
|
* Marks the NavItem with a matching `eventKey` as active. Has a
|
|
27
28
|
* higher precedence over `activeHref`.
|
|
28
29
|
*/
|
|
29
|
-
activeKey:
|
|
30
|
+
activeKey: PropTypes.any,
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Marks the child NavItem with a matching `href` prop as active.
|
|
33
34
|
*/
|
|
34
|
-
activeHref:
|
|
35
|
+
activeHref: PropTypes.string,
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* NavItems are be positioned vertically.
|
|
38
39
|
*/
|
|
39
|
-
stacked:
|
|
40
|
+
stacked: PropTypes.bool,
|
|
40
41
|
|
|
41
|
-
justified: all(
|
|
42
|
+
justified: all(PropTypes.bool, function (_ref) {
|
|
42
43
|
var justified = _ref.justified,
|
|
43
44
|
navbar = _ref.navbar;
|
|
44
45
|
return justified && navbar ? Error('justified navbar `Nav`s are not supported') : null;
|
|
@@ -54,7 +55,7 @@ var propTypes = {
|
|
|
54
55
|
* )
|
|
55
56
|
* ```
|
|
56
57
|
*/
|
|
57
|
-
onSelect:
|
|
58
|
+
onSelect: PropTypes.func,
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* ARIA role for the Nav, in the context of a TabContainer, the default will
|
|
@@ -64,25 +65,25 @@ var propTypes = {
|
|
|
64
65
|
* the ARIA authoring practices for tabs:
|
|
65
66
|
* https://www.w3.org/TR/2013/WD-wai-aria-practices-20130307/#tabpanel
|
|
66
67
|
*/
|
|
67
|
-
role:
|
|
68
|
+
role: PropTypes.string,
|
|
68
69
|
|
|
69
70
|
/**
|
|
70
71
|
* Apply styling an alignment for use in a Navbar. This prop will be set
|
|
71
72
|
* automatically when the Nav is used inside a Navbar.
|
|
72
73
|
*/
|
|
73
|
-
navbar:
|
|
74
|
+
navbar: PropTypes.bool,
|
|
74
75
|
|
|
75
76
|
/**
|
|
76
77
|
* Float the Nav to the right. When `navbar` is `true` the appropriate
|
|
77
78
|
* contextual classes are added as well.
|
|
78
79
|
*/
|
|
79
|
-
pullRight:
|
|
80
|
+
pullRight: PropTypes.bool,
|
|
80
81
|
|
|
81
82
|
/**
|
|
82
83
|
* Float the Nav to the left. When `navbar` is `true` the appropriate
|
|
83
84
|
* contextual classes are added as well.
|
|
84
85
|
*/
|
|
85
|
-
pullLeft:
|
|
86
|
+
pullLeft: PropTypes.bool
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
var defaultProps = {
|
|
@@ -93,16 +94,16 @@ var defaultProps = {
|
|
|
93
94
|
};
|
|
94
95
|
|
|
95
96
|
var contextTypes = {
|
|
96
|
-
$bs_navbar:
|
|
97
|
-
bsClass:
|
|
98
|
-
onSelect:
|
|
97
|
+
$bs_navbar: PropTypes.shape({
|
|
98
|
+
bsClass: PropTypes.string,
|
|
99
|
+
onSelect: PropTypes.func
|
|
99
100
|
}),
|
|
100
101
|
|
|
101
|
-
$bs_tabContainer:
|
|
102
|
-
activeKey:
|
|
103
|
-
onSelect:
|
|
104
|
-
getTabId:
|
|
105
|
-
getPaneId:
|
|
102
|
+
$bs_tabContainer: PropTypes.shape({
|
|
103
|
+
activeKey: PropTypes.any,
|
|
104
|
+
onSelect: PropTypes.func.isRequired,
|
|
105
|
+
getTabId: PropTypes.func.isRequired,
|
|
106
|
+
getPaneId: PropTypes.func.isRequired
|
|
106
107
|
})
|
|
107
108
|
};
|
|
108
109
|
|
|
@@ -166,7 +167,7 @@ var Nav = function (_React$Component) {
|
|
|
166
167
|
|
|
167
168
|
event.preventDefault();
|
|
168
169
|
|
|
169
|
-
if (onSelect && nextActiveChild && nextActiveChild.props.eventKey) {
|
|
170
|
+
if (onSelect && nextActiveChild && nextActiveChild.props.eventKey != null) {
|
|
170
171
|
onSelect(nextActiveChild.props.eventKey);
|
|
171
172
|
}
|
|
172
173
|
|
|
@@ -179,7 +180,7 @@ var Nav = function (_React$Component) {
|
|
|
179
180
|
var children = this.props.children;
|
|
180
181
|
|
|
181
182
|
var validChildren = children.filter(function (child) {
|
|
182
|
-
return child.props.eventKey && !child.props.disabled;
|
|
183
|
+
return child.props.eventKey != null && !child.props.disabled;
|
|
183
184
|
});
|
|
184
185
|
|
|
185
186
|
var _getActiveProps2 = this.getActiveProps(),
|
package/es/NavDropdown.js
CHANGED
|
@@ -5,6 +5,7 @@ import _inherits from 'babel-runtime/helpers/inherits';
|
|
|
5
5
|
import _extends from 'babel-runtime/helpers/extends';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
|
|
9
10
|
import Dropdown from './Dropdown';
|
|
10
11
|
import splitComponentProps from './utils/splitComponentProps';
|
|
@@ -13,15 +14,15 @@ import ValidComponentChildren from './utils/ValidComponentChildren';
|
|
|
13
14
|
var propTypes = _extends({}, Dropdown.propTypes, {
|
|
14
15
|
|
|
15
16
|
// Toggle props.
|
|
16
|
-
title:
|
|
17
|
-
noCaret:
|
|
18
|
-
active:
|
|
17
|
+
title: PropTypes.node.isRequired,
|
|
18
|
+
noCaret: PropTypes.bool,
|
|
19
|
+
active: PropTypes.bool,
|
|
19
20
|
|
|
20
21
|
// Override generated docs from <Dropdown>.
|
|
21
22
|
/**
|
|
22
23
|
* @private
|
|
23
24
|
*/
|
|
24
|
-
children:
|
|
25
|
+
children: PropTypes.node
|
|
25
26
|
});
|
|
26
27
|
|
|
27
28
|
var NavDropdown = function (_React$Component) {
|
package/es/NavItem.js
CHANGED
|
@@ -5,18 +5,19 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
|
|
9
10
|
import SafeAnchor from './SafeAnchor';
|
|
10
11
|
import createChainedFunction from './utils/createChainedFunction';
|
|
11
12
|
|
|
12
13
|
var propTypes = {
|
|
13
|
-
active:
|
|
14
|
-
disabled:
|
|
15
|
-
role:
|
|
16
|
-
href:
|
|
17
|
-
onClick:
|
|
18
|
-
onSelect:
|
|
19
|
-
eventKey:
|
|
14
|
+
active: PropTypes.bool,
|
|
15
|
+
disabled: PropTypes.bool,
|
|
16
|
+
role: PropTypes.string,
|
|
17
|
+
href: PropTypes.string,
|
|
18
|
+
onClick: PropTypes.func,
|
|
19
|
+
onSelect: PropTypes.func,
|
|
20
|
+
eventKey: PropTypes.any
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
var defaultProps = {
|
package/es/Navbar.js
CHANGED
|
@@ -7,7 +7,8 @@ import _inherits from 'babel-runtime/helpers/inherits';
|
|
|
7
7
|
/* eslint-disable react/no-multi-comp */
|
|
8
8
|
|
|
9
9
|
import classNames from 'classnames';
|
|
10
|
-
import React
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import PropTypes from 'prop-types';
|
|
11
12
|
import elementType from 'react-prop-types/lib/elementType';
|
|
12
13
|
import uncontrollable from 'uncontrollable';
|
|
13
14
|
|
|
@@ -25,25 +26,25 @@ var propTypes = {
|
|
|
25
26
|
* Create a fixed navbar along the top of the screen, that scrolls with the
|
|
26
27
|
* page
|
|
27
28
|
*/
|
|
28
|
-
fixedTop:
|
|
29
|
+
fixedTop: PropTypes.bool,
|
|
29
30
|
/**
|
|
30
31
|
* Create a fixed navbar along the bottom of the screen, that scrolls with
|
|
31
32
|
* the page
|
|
32
33
|
*/
|
|
33
|
-
fixedBottom:
|
|
34
|
+
fixedBottom: PropTypes.bool,
|
|
34
35
|
/**
|
|
35
36
|
* Create a full-width navbar that scrolls away with the page
|
|
36
37
|
*/
|
|
37
|
-
staticTop:
|
|
38
|
+
staticTop: PropTypes.bool,
|
|
38
39
|
/**
|
|
39
40
|
* An alternative dark visual style for the Navbar
|
|
40
41
|
*/
|
|
41
|
-
inverse:
|
|
42
|
+
inverse: PropTypes.bool,
|
|
42
43
|
/**
|
|
43
44
|
* Allow the Navbar to fluidly adjust to the page or container width, instead
|
|
44
45
|
* of at the predefined screen breakpoints
|
|
45
46
|
*/
|
|
46
|
-
fluid:
|
|
47
|
+
fluid: PropTypes.bool,
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* Set a custom element for this component.
|
|
@@ -56,7 +57,7 @@ var propTypes = {
|
|
|
56
57
|
*
|
|
57
58
|
* @controllable navExpanded
|
|
58
59
|
*/
|
|
59
|
-
onToggle:
|
|
60
|
+
onToggle: PropTypes.func,
|
|
60
61
|
/**
|
|
61
62
|
* A callback fired when a descendant of a child `<Nav>` is selected. Should
|
|
62
63
|
* be used to execute complex closing or other miscellaneous actions desired
|
|
@@ -78,7 +79,7 @@ var propTypes = {
|
|
|
78
79
|
* ensure that you are setting `expanded` to false and not *toggling* between
|
|
79
80
|
* true and false.
|
|
80
81
|
*/
|
|
81
|
-
onSelect:
|
|
82
|
+
onSelect: PropTypes.func,
|
|
82
83
|
/**
|
|
83
84
|
* Sets `expanded` to `false` after the onSelect event of a descendant of a
|
|
84
85
|
* child `<Nav>`. Does nothing if no `<Nav>` or `<Nav>` descendants exist.
|
|
@@ -86,15 +87,15 @@ var propTypes = {
|
|
|
86
87
|
* The onSelect callback should be used instead for more complex operations
|
|
87
88
|
* that need to be executed after the `select` event of `<Nav>` descendants.
|
|
88
89
|
*/
|
|
89
|
-
collapseOnSelect:
|
|
90
|
+
collapseOnSelect: PropTypes.bool,
|
|
90
91
|
/**
|
|
91
92
|
* Explicitly set the visiblity of the navbar body
|
|
92
93
|
*
|
|
93
94
|
* @controllable onToggle
|
|
94
95
|
*/
|
|
95
|
-
expanded:
|
|
96
|
+
expanded: PropTypes.bool,
|
|
96
97
|
|
|
97
|
-
role:
|
|
98
|
+
role: PropTypes.string
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
var defaultProps = {
|
|
@@ -226,14 +227,15 @@ var UncontrollableNavbar = uncontrollable(Navbar, { expanded: 'onToggle' });
|
|
|
226
227
|
|
|
227
228
|
function createSimpleWrapper(tag, suffix, displayName) {
|
|
228
229
|
var Wrapper = function Wrapper(_ref, _ref2) {
|
|
230
|
+
var _ref2$$bs_navbar = _ref2.$bs_navbar,
|
|
231
|
+
navbarProps = _ref2$$bs_navbar === undefined ? { bsClass: 'navbar' } : _ref2$$bs_navbar;
|
|
232
|
+
|
|
229
233
|
var Component = _ref.componentClass,
|
|
230
234
|
className = _ref.className,
|
|
231
235
|
pullRight = _ref.pullRight,
|
|
232
236
|
pullLeft = _ref.pullLeft,
|
|
233
237
|
props = _objectWithoutProperties(_ref, ['componentClass', 'className', 'pullRight', 'pullLeft']);
|
|
234
238
|
|
|
235
|
-
var _ref2$$bs_navbar = _ref2.$bs_navbar,
|
|
236
|
-
navbarProps = _ref2$$bs_navbar === undefined ? { bsClass: 'navbar' } : _ref2$$bs_navbar;
|
|
237
239
|
return React.createElement(Component, _extends({}, props, {
|
|
238
240
|
className: classNames(className, prefix(navbarProps, suffix), pullRight && prefix(navbarProps, 'right'), pullLeft && prefix(navbarProps, 'left'))
|
|
239
241
|
}));
|
|
@@ -243,8 +245,8 @@ function createSimpleWrapper(tag, suffix, displayName) {
|
|
|
243
245
|
|
|
244
246
|
Wrapper.propTypes = {
|
|
245
247
|
componentClass: elementType,
|
|
246
|
-
pullRight:
|
|
247
|
-
pullLeft:
|
|
248
|
+
pullRight: PropTypes.bool,
|
|
249
|
+
pullLeft: PropTypes.bool
|
|
248
250
|
};
|
|
249
251
|
|
|
250
252
|
Wrapper.defaultProps = {
|
package/es/NavbarBrand.js
CHANGED
|
@@ -5,12 +5,13 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
|
|
9
10
|
import { prefix } from './utils/bootstrapUtils';
|
|
10
11
|
|
|
11
12
|
var contextTypes = {
|
|
12
|
-
$bs_navbar:
|
|
13
|
-
bsClass:
|
|
13
|
+
$bs_navbar: PropTypes.shape({
|
|
14
|
+
bsClass: PropTypes.string
|
|
14
15
|
})
|
|
15
16
|
};
|
|
16
17
|
|
package/es/NavbarCollapse.js
CHANGED
|
@@ -3,7 +3,8 @@ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutPropert
|
|
|
3
3
|
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
4
4
|
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
|
-
import React
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
|
|
8
9
|
import Collapse from './Collapse';
|
|
9
10
|
import { prefix } from './utils/bootstrapUtils';
|