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/Dropdown.js
CHANGED
|
@@ -8,6 +8,7 @@ import activeElement from 'dom-helpers/activeElement';
|
|
|
8
8
|
import contains from 'dom-helpers/query/contains';
|
|
9
9
|
import keycode from 'keycode';
|
|
10
10
|
import React, { cloneElement } from 'react';
|
|
11
|
+
import PropTypes from 'prop-types';
|
|
11
12
|
import ReactDOM from 'react-dom';
|
|
12
13
|
import all from 'react-prop-types/lib/all';
|
|
13
14
|
import elementType from 'react-prop-types/lib/elementType';
|
|
@@ -30,14 +31,14 @@ var propTypes = {
|
|
|
30
31
|
/**
|
|
31
32
|
* The menu will open above the dropdown button, instead of below it.
|
|
32
33
|
*/
|
|
33
|
-
dropup:
|
|
34
|
+
dropup: PropTypes.bool,
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* An html id attribute, necessary for assistive technologies, such as screen readers.
|
|
37
38
|
* @type {string|number}
|
|
38
39
|
* @required
|
|
39
40
|
*/
|
|
40
|
-
id: isRequiredForA11y(
|
|
41
|
+
id: isRequiredForA11y(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
41
42
|
|
|
42
43
|
componentClass: elementType,
|
|
43
44
|
|
|
@@ -50,35 +51,35 @@ var propTypes = {
|
|
|
50
51
|
/**
|
|
51
52
|
* Whether or not component is disabled.
|
|
52
53
|
*/
|
|
53
|
-
disabled:
|
|
54
|
+
disabled: PropTypes.bool,
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
57
|
* Align the menu to the right side of the Dropdown toggle
|
|
57
58
|
*/
|
|
58
|
-
pullRight:
|
|
59
|
+
pullRight: PropTypes.bool,
|
|
59
60
|
|
|
60
61
|
/**
|
|
61
62
|
* Whether or not the Dropdown is visible.
|
|
62
63
|
*
|
|
63
64
|
* @controllable onToggle
|
|
64
65
|
*/
|
|
65
|
-
open:
|
|
66
|
+
open: PropTypes.bool,
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
69
|
* A callback fired when the Dropdown closes.
|
|
69
70
|
*/
|
|
70
|
-
onClose:
|
|
71
|
+
onClose: PropTypes.func,
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
74
|
* A callback fired when the Dropdown wishes to change visibility. Called with the requested
|
|
74
|
-
* `open` value
|
|
75
|
+
* `open` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`.
|
|
75
76
|
*
|
|
76
77
|
* ```js
|
|
77
|
-
* function(Boolean isOpen) {}
|
|
78
|
+
* function(Boolean isOpen, Object event, { String source }) {}
|
|
78
79
|
* ```
|
|
79
80
|
* @controllable open
|
|
80
81
|
*/
|
|
81
|
-
onToggle:
|
|
82
|
+
onToggle: PropTypes.func,
|
|
82
83
|
|
|
83
84
|
/**
|
|
84
85
|
* A callback fired when a menu item is selected.
|
|
@@ -87,18 +88,27 @@ var propTypes = {
|
|
|
87
88
|
* (eventKey: any, event: Object) => any
|
|
88
89
|
* ```
|
|
89
90
|
*/
|
|
90
|
-
onSelect:
|
|
91
|
+
onSelect: PropTypes.func,
|
|
91
92
|
|
|
92
93
|
/**
|
|
93
94
|
* If `'menuitem'`, causes the dropdown to behave like a menu item rather than
|
|
94
95
|
* a menu button.
|
|
95
96
|
*/
|
|
96
|
-
role:
|
|
97
|
+
role: PropTypes.string,
|
|
97
98
|
|
|
98
99
|
/**
|
|
99
100
|
* Which event when fired outside the component will cause it to be closed
|
|
100
101
|
*/
|
|
101
|
-
rootCloseEvent:
|
|
102
|
+
rootCloseEvent: PropTypes.oneOf(['click', 'mousedown']),
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @private
|
|
106
|
+
*/
|
|
107
|
+
onMouseEnter: PropTypes.func,
|
|
108
|
+
/**
|
|
109
|
+
* @private
|
|
110
|
+
*/
|
|
111
|
+
onMouseLeave: PropTypes.func
|
|
102
112
|
};
|
|
103
113
|
|
|
104
114
|
var defaultProps = {
|
|
@@ -151,12 +161,12 @@ var Dropdown = function (_React$Component) {
|
|
|
151
161
|
}
|
|
152
162
|
};
|
|
153
163
|
|
|
154
|
-
Dropdown.prototype.handleClick = function handleClick() {
|
|
164
|
+
Dropdown.prototype.handleClick = function handleClick(event) {
|
|
155
165
|
if (this.props.disabled) {
|
|
156
166
|
return;
|
|
157
167
|
}
|
|
158
168
|
|
|
159
|
-
this.toggleOpen('click');
|
|
169
|
+
this.toggleOpen(event, { source: 'click' });
|
|
160
170
|
};
|
|
161
171
|
|
|
162
172
|
Dropdown.prototype.handleKeyDown = function handleKeyDown(event) {
|
|
@@ -167,7 +177,7 @@ var Dropdown = function (_React$Component) {
|
|
|
167
177
|
switch (event.keyCode) {
|
|
168
178
|
case keycode.codes.down:
|
|
169
179
|
if (!this.props.open) {
|
|
170
|
-
this.toggleOpen('keydown');
|
|
180
|
+
this.toggleOpen(event, { source: 'keydown' });
|
|
171
181
|
} else if (this.menu.focusNext) {
|
|
172
182
|
this.menu.focusNext();
|
|
173
183
|
}
|
|
@@ -175,30 +185,30 @@ var Dropdown = function (_React$Component) {
|
|
|
175
185
|
break;
|
|
176
186
|
case keycode.codes.esc:
|
|
177
187
|
case keycode.codes.tab:
|
|
178
|
-
this.handleClose(event);
|
|
188
|
+
this.handleClose(event, { source: 'keydown' });
|
|
179
189
|
break;
|
|
180
190
|
default:
|
|
181
191
|
}
|
|
182
192
|
};
|
|
183
193
|
|
|
184
|
-
Dropdown.prototype.toggleOpen = function toggleOpen(
|
|
194
|
+
Dropdown.prototype.toggleOpen = function toggleOpen(event, eventDetails) {
|
|
185
195
|
var open = !this.props.open;
|
|
186
196
|
|
|
187
197
|
if (open) {
|
|
188
|
-
this.lastOpenEventType =
|
|
198
|
+
this.lastOpenEventType = eventDetails.source;
|
|
189
199
|
}
|
|
190
200
|
|
|
191
201
|
if (this.props.onToggle) {
|
|
192
|
-
this.props.onToggle(open);
|
|
202
|
+
this.props.onToggle(open, event, eventDetails);
|
|
193
203
|
}
|
|
194
204
|
};
|
|
195
205
|
|
|
196
|
-
Dropdown.prototype.handleClose = function handleClose() {
|
|
206
|
+
Dropdown.prototype.handleClose = function handleClose(event, eventDetails) {
|
|
197
207
|
if (!this.props.open) {
|
|
198
208
|
return;
|
|
199
209
|
}
|
|
200
210
|
|
|
201
|
-
this.toggleOpen(
|
|
211
|
+
this.toggleOpen(event, eventDetails);
|
|
202
212
|
};
|
|
203
213
|
|
|
204
214
|
Dropdown.prototype.focusNextOnOpen = function focusNextOnOpen() {
|
|
@@ -266,7 +276,9 @@ var Dropdown = function (_React$Component) {
|
|
|
266
276
|
labelledBy: id,
|
|
267
277
|
bsClass: prefix(props, 'menu'),
|
|
268
278
|
onClose: createChainedFunction(child.props.onClose, onClose, this.handleClose),
|
|
269
|
-
onSelect: createChainedFunction(child.props.onSelect, onSelect,
|
|
279
|
+
onSelect: createChainedFunction(child.props.onSelect, onSelect, function (key, event) {
|
|
280
|
+
return _this3.handleClose(event, { source: 'select' });
|
|
281
|
+
}),
|
|
270
282
|
rootCloseEvent: rootCloseEvent
|
|
271
283
|
}));
|
|
272
284
|
};
|
package/es/DropdownButton.js
CHANGED
|
@@ -4,6 +4,7 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
4
4
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
5
5
|
import _extends from 'babel-runtime/helpers/extends';
|
|
6
6
|
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
|
|
8
9
|
import Dropdown from './Dropdown';
|
|
9
10
|
import splitComponentProps from './utils/splitComponentProps';
|
|
@@ -11,16 +12,16 @@ import splitComponentProps from './utils/splitComponentProps';
|
|
|
11
12
|
var propTypes = _extends({}, Dropdown.propTypes, {
|
|
12
13
|
|
|
13
14
|
// Toggle props.
|
|
14
|
-
bsStyle:
|
|
15
|
-
bsSize:
|
|
16
|
-
title:
|
|
17
|
-
noCaret:
|
|
15
|
+
bsStyle: PropTypes.string,
|
|
16
|
+
bsSize: PropTypes.string,
|
|
17
|
+
title: PropTypes.node.isRequired,
|
|
18
|
+
noCaret: PropTypes.bool,
|
|
18
19
|
|
|
19
20
|
// Override generated docs from <Dropdown>.
|
|
20
21
|
/**
|
|
21
22
|
* @private
|
|
22
23
|
*/
|
|
23
|
-
children:
|
|
24
|
+
children: PropTypes.node
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
var DropdownButton = function (_React$Component) {
|
package/es/DropdownMenu.js
CHANGED
|
@@ -7,20 +7,21 @@ import _inherits from 'babel-runtime/helpers/inherits';
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import keycode from 'keycode';
|
|
9
9
|
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
10
11
|
import ReactDOM from 'react-dom';
|
|
11
12
|
import RootCloseWrapper from 'react-overlays/lib/RootCloseWrapper';
|
|
12
13
|
|
|
13
|
-
import { bsClass, getClassSet, prefix,
|
|
14
|
+
import { bsClass, getClassSet, prefix, splitBsPropsAndOmit } from './utils/bootstrapUtils';
|
|
14
15
|
import createChainedFunction from './utils/createChainedFunction';
|
|
15
16
|
import ValidComponentChildren from './utils/ValidComponentChildren';
|
|
16
17
|
|
|
17
18
|
var propTypes = {
|
|
18
|
-
open:
|
|
19
|
-
pullRight:
|
|
20
|
-
onClose:
|
|
21
|
-
labelledBy:
|
|
22
|
-
onSelect:
|
|
23
|
-
rootCloseEvent:
|
|
19
|
+
open: PropTypes.bool,
|
|
20
|
+
pullRight: PropTypes.bool,
|
|
21
|
+
onClose: PropTypes.func,
|
|
22
|
+
labelledBy: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
23
|
+
onSelect: PropTypes.func,
|
|
24
|
+
rootCloseEvent: PropTypes.oneOf(['click', 'mousedown'])
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
var defaultProps = {
|
|
@@ -36,10 +37,15 @@ var DropdownMenu = function (_React$Component) {
|
|
|
36
37
|
|
|
37
38
|
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
|
|
38
39
|
|
|
40
|
+
_this.handleRootClose = _this.handleRootClose.bind(_this);
|
|
39
41
|
_this.handleKeyDown = _this.handleKeyDown.bind(_this);
|
|
40
42
|
return _this;
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
DropdownMenu.prototype.handleRootClose = function handleRootClose(event) {
|
|
46
|
+
this.props.onClose(event, { source: 'rootClose' });
|
|
47
|
+
};
|
|
48
|
+
|
|
43
49
|
DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
|
|
44
50
|
switch (event.keyCode) {
|
|
45
51
|
case keycode.codes.down:
|
|
@@ -52,7 +58,7 @@ var DropdownMenu = function (_React$Component) {
|
|
|
52
58
|
break;
|
|
53
59
|
case keycode.codes.esc:
|
|
54
60
|
case keycode.codes.tab:
|
|
55
|
-
this.props.onClose(event);
|
|
61
|
+
this.props.onClose(event, { source: 'keydown' });
|
|
56
62
|
break;
|
|
57
63
|
default:
|
|
58
64
|
}
|
|
@@ -107,17 +113,16 @@ var DropdownMenu = function (_React$Component) {
|
|
|
107
113
|
var _props = this.props,
|
|
108
114
|
open = _props.open,
|
|
109
115
|
pullRight = _props.pullRight,
|
|
110
|
-
onClose = _props.onClose,
|
|
111
116
|
labelledBy = _props.labelledBy,
|
|
112
117
|
onSelect = _props.onSelect,
|
|
113
118
|
className = _props.className,
|
|
114
119
|
rootCloseEvent = _props.rootCloseEvent,
|
|
115
120
|
children = _props.children,
|
|
116
|
-
props = _objectWithoutProperties(_props, ['open', 'pullRight', '
|
|
121
|
+
props = _objectWithoutProperties(_props, ['open', 'pullRight', 'labelledBy', 'onSelect', 'className', 'rootCloseEvent', 'children']);
|
|
117
122
|
|
|
118
|
-
var
|
|
119
|
-
bsProps =
|
|
120
|
-
elementProps =
|
|
123
|
+
var _splitBsPropsAndOmit = splitBsPropsAndOmit(props, ['onClose']),
|
|
124
|
+
bsProps = _splitBsPropsAndOmit[0],
|
|
125
|
+
elementProps = _splitBsPropsAndOmit[1];
|
|
121
126
|
|
|
122
127
|
var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, 'right')] = pullRight, _extends2));
|
|
123
128
|
|
|
@@ -125,7 +130,7 @@ var DropdownMenu = function (_React$Component) {
|
|
|
125
130
|
RootCloseWrapper,
|
|
126
131
|
{
|
|
127
132
|
disabled: !open,
|
|
128
|
-
onRootClose:
|
|
133
|
+
onRootClose: this.handleRootClose,
|
|
129
134
|
event: rootCloseEvent
|
|
130
135
|
},
|
|
131
136
|
React.createElement(
|
package/es/DropdownToggle.js
CHANGED
|
@@ -4,6 +4,7 @@ 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
6
|
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import classNames from 'classnames';
|
|
8
9
|
import Button from './Button';
|
|
9
10
|
import SafeAnchor from './SafeAnchor';
|
|
@@ -11,10 +12,10 @@ import SafeAnchor from './SafeAnchor';
|
|
|
11
12
|
import { bsClass as setBsClass } from './utils/bootstrapUtils';
|
|
12
13
|
|
|
13
14
|
var propTypes = {
|
|
14
|
-
noCaret:
|
|
15
|
-
open:
|
|
16
|
-
title:
|
|
17
|
-
useAnchor:
|
|
15
|
+
noCaret: PropTypes.bool,
|
|
16
|
+
open: PropTypes.bool,
|
|
17
|
+
title: PropTypes.string,
|
|
18
|
+
useAnchor: PropTypes.bool
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
var defaultProps = {
|
package/es/Fade.js
CHANGED
|
@@ -4,61 +4,68 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
4
4
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import Transition from 'react-overlays/lib/Transition';
|
|
8
9
|
|
|
9
10
|
var propTypes = {
|
|
10
11
|
/**
|
|
11
12
|
* Show the component; triggers the fade in or fade out animation
|
|
12
13
|
*/
|
|
13
|
-
'in':
|
|
14
|
+
'in': PropTypes.bool,
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Wait until the first "enter" transition to mount the component (add it to the DOM)
|
|
18
|
+
*/
|
|
19
|
+
mountOnEnter: PropTypes.bool,
|
|
14
20
|
|
|
15
21
|
/**
|
|
16
22
|
* Unmount the component (remove it from the DOM) when it is faded out
|
|
17
23
|
*/
|
|
18
|
-
unmountOnExit:
|
|
24
|
+
unmountOnExit: PropTypes.bool,
|
|
19
25
|
|
|
20
26
|
/**
|
|
21
27
|
* Run the fade in animation when the component mounts, if it is initially
|
|
22
28
|
* shown
|
|
23
29
|
*/
|
|
24
|
-
transitionAppear:
|
|
30
|
+
transitionAppear: PropTypes.bool,
|
|
25
31
|
|
|
26
32
|
/**
|
|
27
33
|
* Duration of the fade animation in milliseconds, to ensure that finishing
|
|
28
34
|
* callbacks are fired even if the original browser transition end events are
|
|
29
35
|
* canceled
|
|
30
36
|
*/
|
|
31
|
-
timeout:
|
|
37
|
+
timeout: PropTypes.number,
|
|
32
38
|
|
|
33
39
|
/**
|
|
34
40
|
* Callback fired before the component fades in
|
|
35
41
|
*/
|
|
36
|
-
onEnter:
|
|
42
|
+
onEnter: PropTypes.func,
|
|
37
43
|
/**
|
|
38
44
|
* Callback fired after the component starts to fade in
|
|
39
45
|
*/
|
|
40
|
-
onEntering:
|
|
46
|
+
onEntering: PropTypes.func,
|
|
41
47
|
/**
|
|
42
48
|
* Callback fired after the has component faded in
|
|
43
49
|
*/
|
|
44
|
-
onEntered:
|
|
50
|
+
onEntered: PropTypes.func,
|
|
45
51
|
/**
|
|
46
52
|
* Callback fired before the component fades out
|
|
47
53
|
*/
|
|
48
|
-
onExit:
|
|
54
|
+
onExit: PropTypes.func,
|
|
49
55
|
/**
|
|
50
56
|
* Callback fired after the component starts to fade out
|
|
51
57
|
*/
|
|
52
|
-
onExiting:
|
|
58
|
+
onExiting: PropTypes.func,
|
|
53
59
|
/**
|
|
54
60
|
* Callback fired after the component has faded out
|
|
55
61
|
*/
|
|
56
|
-
onExited:
|
|
62
|
+
onExited: PropTypes.func
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
var defaultProps = {
|
|
60
66
|
'in': false,
|
|
61
67
|
timeout: 300,
|
|
68
|
+
mountOnEnter: false,
|
|
62
69
|
unmountOnExit: false,
|
|
63
70
|
transitionAppear: false
|
|
64
71
|
};
|
package/es/Form.js
CHANGED
|
@@ -5,13 +5,14 @@ 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 elementType from 'react-prop-types/lib/elementType';
|
|
9
10
|
|
|
10
11
|
import { bsClass, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
11
12
|
|
|
12
13
|
var propTypes = {
|
|
13
|
-
horizontal:
|
|
14
|
-
inline:
|
|
14
|
+
horizontal: PropTypes.bool,
|
|
15
|
+
inline: PropTypes.bool,
|
|
15
16
|
componentClass: elementType
|
|
16
17
|
};
|
|
17
18
|
|
package/es/FormControl.js
CHANGED
|
@@ -5,23 +5,34 @@ 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 elementType from 'react-prop-types/lib/elementType';
|
|
9
10
|
import warning from 'warning';
|
|
10
11
|
|
|
11
12
|
import FormControlFeedback from './FormControlFeedback';
|
|
12
13
|
import FormControlStatic from './FormControlStatic';
|
|
13
|
-
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
14
|
+
import { bsClass, getClassSet, splitBsProps, bsSizes } from './utils/bootstrapUtils';
|
|
15
|
+
import { SIZE_MAP, Size } from './utils/StyleConfig';
|
|
16
|
+
import { prefix } from './utils/bootstrapUtils';
|
|
14
17
|
|
|
15
18
|
var propTypes = {
|
|
16
19
|
componentClass: elementType,
|
|
17
20
|
/**
|
|
18
21
|
* Only relevant if `componentClass` is `'input'`.
|
|
19
22
|
*/
|
|
20
|
-
type:
|
|
23
|
+
type: PropTypes.string,
|
|
21
24
|
/**
|
|
22
25
|
* Uses `controlId` from `<FormGroup>` if not explicitly specified.
|
|
23
26
|
*/
|
|
24
|
-
id:
|
|
27
|
+
id: PropTypes.string,
|
|
28
|
+
/**
|
|
29
|
+
* Attaches a ref to the `<input>` element. Only functions can be used here.
|
|
30
|
+
*
|
|
31
|
+
* ```js
|
|
32
|
+
* <FormControl inputRef={ref => { this.input = ref; }} />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
inputRef: PropTypes.func
|
|
25
36
|
};
|
|
26
37
|
|
|
27
38
|
var defaultProps = {
|
|
@@ -29,7 +40,7 @@ var defaultProps = {
|
|
|
29
40
|
};
|
|
30
41
|
|
|
31
42
|
var contextTypes = {
|
|
32
|
-
$bs_formGroup:
|
|
43
|
+
$bs_formGroup: PropTypes.object
|
|
33
44
|
};
|
|
34
45
|
|
|
35
46
|
var FormControl = function (_React$Component) {
|
|
@@ -50,8 +61,10 @@ var FormControl = function (_React$Component) {
|
|
|
50
61
|
type = _props.type,
|
|
51
62
|
_props$id = _props.id,
|
|
52
63
|
id = _props$id === undefined ? controlId : _props$id,
|
|
64
|
+
inputRef = _props.inputRef,
|
|
53
65
|
className = _props.className,
|
|
54
|
-
|
|
66
|
+
bsSize = _props.bsSize,
|
|
67
|
+
props = _objectWithoutProperties(_props, ['componentClass', 'type', 'id', 'inputRef', 'className', 'bsSize']);
|
|
55
68
|
|
|
56
69
|
var _splitBsProps = splitBsProps(props),
|
|
57
70
|
bsProps = _splitBsProps[0],
|
|
@@ -65,9 +78,17 @@ var FormControl = function (_React$Component) {
|
|
|
65
78
|
classes = getClassSet(bsProps);
|
|
66
79
|
}
|
|
67
80
|
|
|
81
|
+
// If user provides a size, make sure to append it to classes as input-
|
|
82
|
+
// e.g. if bsSize is small, it will append input-sm
|
|
83
|
+
if (bsSize) {
|
|
84
|
+
var size = SIZE_MAP[bsSize] || bsSize;
|
|
85
|
+
classes[prefix({ bsClass: 'input' }, size)] = true;
|
|
86
|
+
}
|
|
87
|
+
|
|
68
88
|
return React.createElement(Component, _extends({}, elementProps, {
|
|
69
89
|
type: type,
|
|
70
90
|
id: id,
|
|
91
|
+
ref: inputRef,
|
|
71
92
|
className: classNames(className, classes)
|
|
72
93
|
}));
|
|
73
94
|
};
|
|
@@ -82,4 +103,4 @@ FormControl.contextTypes = contextTypes;
|
|
|
82
103
|
FormControl.Feedback = FormControlFeedback;
|
|
83
104
|
FormControl.Static = FormControlStatic;
|
|
84
105
|
|
|
85
|
-
export default bsClass('form-control', FormControl);
|
|
106
|
+
export default bsClass('form-control', bsSizes([Size.SMALL, Size.LARGE], FormControl));
|
|
@@ -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 Glyphicon from './Glyphicon';
|
|
10
11
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
@@ -14,7 +15,7 @@ var defaultProps = {
|
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
var contextTypes = {
|
|
17
|
-
$bs_formGroup:
|
|
18
|
+
$bs_formGroup: PropTypes.object
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
var FormControlFeedback = function (_React$Component) {
|
package/es/FormGroup.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, splitBsPropsAndOmit } from './utils/bootstrapUtils';
|
|
10
11
|
import { Size } from './utils/StyleConfig';
|
|
@@ -14,12 +15,12 @@ var propTypes = {
|
|
|
14
15
|
/**
|
|
15
16
|
* Sets `id` on `<FormControl>` and `htmlFor` on `<FormGroup.Label>`.
|
|
16
17
|
*/
|
|
17
|
-
controlId:
|
|
18
|
-
validationState:
|
|
18
|
+
controlId: PropTypes.string,
|
|
19
|
+
validationState: PropTypes.oneOf(['success', 'warning', 'error', null])
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
var childContextTypes = {
|
|
22
|
-
$bs_formGroup:
|
|
23
|
+
$bs_formGroup: PropTypes.object.isRequired
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
var FormGroup = function (_React$Component) {
|
package/es/Glyphicon.js
CHANGED
|
@@ -5,14 +5,15 @@ 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, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
10
11
|
|
|
11
12
|
var propTypes = {
|
|
12
13
|
/**
|
|
13
|
-
* An icon name. See e.g. http://getbootstrap.com/components/#glyphicons
|
|
14
|
+
* An icon name without "glyphicon-" prefix. See e.g. http://getbootstrap.com/components/#glyphicons
|
|
14
15
|
*/
|
|
15
|
-
glyph:
|
|
16
|
+
glyph: PropTypes.string.isRequired
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
var Glyphicon = function (_React$Component) {
|
package/es/Grid.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 elementType from 'react-prop-types/lib/elementType';
|
|
9
10
|
|
|
10
11
|
import { bsClass, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
@@ -15,7 +16,7 @@ var propTypes = {
|
|
|
15
16
|
*
|
|
16
17
|
* Adds `container-fluid` class.
|
|
17
18
|
*/
|
|
18
|
-
fluid:
|
|
19
|
+
fluid: PropTypes.bool,
|
|
19
20
|
/**
|
|
20
21
|
* You can use a custom element for this component
|
|
21
22
|
*/
|
package/es/Image.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, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
10
11
|
|
|
@@ -12,22 +13,22 @@ var propTypes = {
|
|
|
12
13
|
/**
|
|
13
14
|
* Sets image as responsive image
|
|
14
15
|
*/
|
|
15
|
-
responsive:
|
|
16
|
+
responsive: PropTypes.bool,
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Sets image shape as rounded
|
|
19
20
|
*/
|
|
20
|
-
rounded:
|
|
21
|
+
rounded: PropTypes.bool,
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Sets image shape as circle
|
|
24
25
|
*/
|
|
25
|
-
circle:
|
|
26
|
+
circle: PropTypes.bool,
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Sets image shape as thumbnail
|
|
29
30
|
*/
|
|
30
|
-
thumbnail:
|
|
31
|
+
thumbnail: PropTypes.bool
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
var defaultProps = {
|
package/es/ListGroupItem.js
CHANGED
|
@@ -6,18 +6,19 @@ import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructo
|
|
|
6
6
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import React, { cloneElement } from 'react';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
9
10
|
|
|
10
11
|
import { bsClass, bsStyles, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
11
12
|
import { State } from './utils/StyleConfig';
|
|
12
13
|
|
|
13
14
|
var propTypes = {
|
|
14
|
-
active:
|
|
15
|
-
disabled:
|
|
16
|
-
header:
|
|
17
|
-
listItem:
|
|
18
|
-
onClick:
|
|
19
|
-
href:
|
|
20
|
-
type:
|
|
15
|
+
active: PropTypes.any,
|
|
16
|
+
disabled: PropTypes.any,
|
|
17
|
+
header: PropTypes.node,
|
|
18
|
+
listItem: PropTypes.bool,
|
|
19
|
+
onClick: PropTypes.func,
|
|
20
|
+
href: PropTypes.string,
|
|
21
|
+
type: PropTypes.string
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
var defaultProps = {
|
package/es/MediaLeft.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 Media from './Media';
|
|
10
11
|
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
@@ -13,7 +14,7 @@ var propTypes = {
|
|
|
13
14
|
/**
|
|
14
15
|
* Align the media to the top, middle, or bottom of the media object.
|
|
15
16
|
*/
|
|
16
|
-
align:
|
|
17
|
+
align: PropTypes.oneOf(['top', 'middle', 'bottom'])
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
var MediaLeft = function (_React$Component) {
|
package/es/MediaRight.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 Media from './Media';
|
|
10
11
|
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
@@ -13,7 +14,7 @@ var propTypes = {
|
|
|
13
14
|
/**
|
|
14
15
|
* Align the media to the top, middle, or bottom of the media object.
|
|
15
16
|
*/
|
|
16
|
-
align:
|
|
17
|
+
align: PropTypes.oneOf(['top', 'middle', 'bottom'])
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
var MediaRight = function (_React$Component) {
|