react-bootstrap 0.31.3 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/README.md +1 -0
- package/dist/react-bootstrap.js +14493 -17076
- package/dist/react-bootstrap.min.js +18479 -16
- package/es/Alert.js +1 -4
- package/es/Badge.js +1 -3
- package/es/ButtonGroup.js +1 -3
- package/es/Carousel.js +79 -79
- package/es/CarouselCaption.js +1 -3
- package/es/CarouselItem.js +3 -9
- package/es/Checkbox.js +7 -1
- package/es/Clearfix.js +1 -3
- package/es/CloseButton.js +1 -5
- package/es/Col.js +1 -3
- package/es/Collapse.js +58 -65
- package/es/Dropdown.js +66 -55
- package/es/DropdownButton.js +2 -8
- package/es/DropdownMenu.js +28 -28
- package/es/Fade.js +25 -10
- package/es/Form.js +1 -3
- package/es/FormControl.js +1 -2
- package/es/FormControlStatic.js +1 -3
- package/es/FormGroup.js +1 -3
- package/es/Glyphicon.js +1 -3
- package/es/Grid.js +1 -3
- package/es/HelpBlock.js +1 -3
- package/es/InputGroup.js +1 -3
- package/es/InputGroupAddon.js +1 -3
- package/es/InputGroupButton.js +1 -3
- package/es/Jumbotron.js +1 -3
- package/es/Label.js +1 -3
- package/es/ListGroup.js +1 -3
- package/es/Media.js +1 -3
- package/es/MediaBody.js +16 -5
- package/es/MediaHeading.js +1 -3
- package/es/MediaLeft.js +1 -3
- package/es/MediaList.js +1 -3
- package/es/MediaListItem.js +1 -3
- package/es/MediaRight.js +1 -3
- package/es/Modal.js +30 -19
- package/es/ModalBody.js +1 -3
- package/es/ModalFooter.js +1 -3
- package/es/ModalHeader.js +2 -4
- package/es/ModalTitle.js +1 -3
- package/es/Nav.js +44 -44
- package/es/NavDropdown.js +2 -0
- package/es/NavItem.js +5 -4
- package/es/Navbar.js +5 -7
- package/es/Overlay.js +1 -3
- package/es/OverlayTrigger.js +43 -43
- package/es/PageHeader.js +1 -3
- package/es/Pager.js +1 -3
- package/es/PagerItem.js +1 -4
- package/es/Pagination.js +15 -224
- package/es/PaginationItem.js +102 -0
- package/es/Panel.js +114 -173
- package/es/PanelBody.js +84 -0
- package/es/PanelCollapse.js +94 -0
- package/es/PanelFooter.js +53 -0
- package/es/PanelGroup.js +95 -52
- package/es/PanelHeading.js +75 -0
- package/es/PanelTitle.js +83 -0
- package/es/PanelToggle.js +94 -0
- package/es/ProgressBar.js +12 -8
- package/es/Radio.js +7 -1
- package/es/Row.js +1 -3
- package/es/SplitButton.js +1 -4
- package/es/SplitToggle.js +1 -4
- package/es/TabContent.js +7 -7
- package/es/TabPane.js +18 -18
- package/es/Table.js +1 -3
- package/es/Tabs.js +4 -10
- package/es/Thumbnail.js +3 -3
- package/es/ToggleButton.js +1 -4
- package/es/Well.js +1 -3
- package/es/index.js +0 -2
- package/es/utils/PropTypes.js +26 -4
- package/es/utils/ValidComponentChildren.js +1 -1
- package/es/utils/bootstrapUtils.js +5 -3
- package/lib/Accordion.js +9 -9
- package/lib/Alert.js +14 -17
- package/lib/Badge.js +12 -14
- package/lib/Breadcrumb.js +10 -10
- package/lib/BreadcrumbItem.js +14 -14
- package/lib/Button.js +20 -20
- package/lib/ButtonGroup.js +12 -14
- package/lib/ButtonToolbar.js +9 -9
- package/lib/Carousel.js +121 -121
- package/lib/CarouselCaption.js +9 -11
- package/lib/CarouselItem.js +17 -22
- package/lib/Checkbox.js +25 -21
- package/lib/Clearfix.js +14 -16
- package/lib/CloseButton.js +12 -16
- package/lib/Col.js +29 -31
- package/lib/Collapse.js +84 -92
- package/lib/ControlLabel.js +14 -14
- package/lib/Dropdown.js +106 -95
- package/lib/DropdownButton.js +22 -28
- package/lib/DropdownMenu.js +51 -51
- package/lib/DropdownToggle.js +16 -16
- package/lib/Fade.js +43 -25
- package/lib/Form.js +11 -13
- package/lib/FormControl.js +17 -17
- package/lib/FormControlFeedback.js +13 -13
- package/lib/FormControlStatic.js +9 -11
- package/lib/FormGroup.js +14 -16
- package/lib/Glyphicon.js +10 -12
- package/lib/Grid.js +10 -12
- package/lib/HelpBlock.js +8 -10
- package/lib/Image.js +13 -13
- package/lib/InputGroup.js +10 -12
- package/lib/InputGroupAddon.js +8 -10
- package/lib/InputGroupButton.js +8 -10
- package/lib/Jumbotron.js +9 -11
- package/lib/Label.js +11 -13
- package/lib/ListGroup.js +15 -17
- package/lib/ListGroupItem.js +22 -22
- package/lib/Media.js +15 -17
- package/lib/MediaBody.js +28 -11
- package/lib/MediaHeading.js +9 -11
- package/lib/MediaLeft.js +10 -12
- package/lib/MediaList.js +8 -10
- package/lib/MediaListItem.js +8 -10
- package/lib/MediaRight.js +10 -12
- package/lib/MenuItem.js +23 -23
- package/lib/Modal.js +80 -69
- package/lib/ModalBody.js +9 -11
- package/lib/ModalDialog.js +16 -16
- package/lib/ModalFooter.js +9 -11
- package/lib/ModalHeader.js +20 -22
- package/lib/ModalTitle.js +9 -11
- package/lib/Nav.js +81 -81
- package/lib/NavDropdown.js +27 -25
- package/lib/NavItem.js +23 -22
- package/lib/Navbar.js +46 -48
- package/lib/NavbarBrand.js +14 -14
- package/lib/NavbarCollapse.js +14 -14
- package/lib/NavbarHeader.js +10 -10
- package/lib/NavbarToggle.js +22 -22
- package/lib/Overlay.js +25 -27
- package/lib/OverlayTrigger.js +79 -79
- package/lib/PageHeader.js +10 -12
- package/lib/PageItem.js +2 -2
- package/lib/Pager.js +13 -15
- package/lib/PagerItem.js +18 -21
- package/lib/Pagination.js +25 -240
- package/lib/PaginationItem.js +135 -0
- package/lib/Panel.js +142 -180
- package/lib/PanelBody.js +114 -0
- package/lib/PanelCollapse.js +120 -0
- package/lib/PanelFooter.js +80 -0
- package/lib/PanelGroup.js +111 -70
- package/lib/PanelHeading.js +107 -0
- package/lib/PanelTitle.js +118 -0
- package/lib/PanelToggle.js +130 -0
- package/lib/Popover.js +22 -22
- package/lib/ProgressBar.js +39 -35
- package/lib/Radio.js +25 -21
- package/lib/ResponsiveEmbed.js +17 -17
- package/lib/Row.js +9 -11
- package/lib/SafeAnchor.js +17 -17
- package/lib/SplitButton.js +26 -29
- package/lib/SplitToggle.js +8 -11
- package/lib/Tab.js +15 -15
- package/lib/TabContainer.js +17 -17
- package/lib/TabContent.js +31 -31
- package/lib/TabPane.js +59 -59
- package/lib/Table.js +15 -17
- package/lib/Tabs.js +29 -35
- package/lib/Thumbnail.js +18 -20
- package/lib/ToggleButton.js +17 -20
- package/lib/ToggleButtonGroup.js +20 -20
- package/lib/Tooltip.js +20 -20
- package/lib/Well.js +8 -10
- package/lib/index.js +74 -79
- package/lib/utils/PropTypes.js +35 -9
- package/lib/utils/ValidComponentChildren.js +19 -19
- package/lib/utils/bootstrapUtils.js +13 -11
- package/lib/utils/capitalize.js +1 -1
- package/lib/utils/createChainedFunction.js +1 -1
- package/lib/utils/deprecationWarning.js +7 -7
- package/lib/utils/index.js +4 -4
- package/lib/utils/splitComponentProps.js +3 -3
- package/package.json +54 -64
- package/dist/react-bootstrap.min.js.map +0 -1
- package/es/PaginationButton.js +0 -98
- package/es/utils/TransitionEvents.js +0 -109
- package/lib/PaginationButton.js +0 -137
- package/lib/utils/TransitionEvents.js +0 -113
package/es/Dropdown.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
2
1
|
import _extends from 'babel-runtime/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
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';
|
|
@@ -95,6 +95,10 @@ var propTypes = {
|
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Which event when fired outside the component will cause it to be closed
|
|
98
|
+
*
|
|
99
|
+
* *Note: For custom dropdown components, you will have to pass the
|
|
100
|
+
* `rootCloseEvent` to `<RootCloseWrapper>` in your custom dropdown menu
|
|
101
|
+
* component ([similarly to how it is implemented in `<Dropdown.Menu>`](https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.5/src/DropdownMenu.js#L115-L119)).*
|
|
98
102
|
*/
|
|
99
103
|
rootCloseEvent: PropTypes.oneOf(['click', 'mousedown']),
|
|
100
104
|
|
|
@@ -158,6 +162,26 @@ var Dropdown = function (_React$Component) {
|
|
|
158
162
|
}
|
|
159
163
|
};
|
|
160
164
|
|
|
165
|
+
Dropdown.prototype.focus = function focus() {
|
|
166
|
+
var toggle = ReactDOM.findDOMNode(this.toggle);
|
|
167
|
+
|
|
168
|
+
if (toggle && toggle.focus) {
|
|
169
|
+
toggle.focus();
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
Dropdown.prototype.focusNextOnOpen = function focusNextOnOpen() {
|
|
174
|
+
var menu = this.menu;
|
|
175
|
+
|
|
176
|
+
if (!menu.focusNext) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (this.lastOpenEventType === 'keydown' || this.props.role === 'menuitem') {
|
|
181
|
+
menu.focusNext();
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
161
185
|
Dropdown.prototype.handleClick = function handleClick(event) {
|
|
162
186
|
if (this.props.disabled) {
|
|
163
187
|
return;
|
|
@@ -166,6 +190,14 @@ var Dropdown = function (_React$Component) {
|
|
|
166
190
|
this.toggleOpen(event, { source: 'click' });
|
|
167
191
|
};
|
|
168
192
|
|
|
193
|
+
Dropdown.prototype.handleClose = function handleClose(event, eventDetails) {
|
|
194
|
+
if (!this.props.open) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
this.toggleOpen(event, eventDetails);
|
|
199
|
+
};
|
|
200
|
+
|
|
169
201
|
Dropdown.prototype.handleKeyDown = function handleKeyDown(event) {
|
|
170
202
|
if (this.props.disabled) {
|
|
171
203
|
return;
|
|
@@ -200,82 +232,54 @@ var Dropdown = function (_React$Component) {
|
|
|
200
232
|
}
|
|
201
233
|
};
|
|
202
234
|
|
|
203
|
-
Dropdown.prototype.
|
|
204
|
-
if (!this.props.open) {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
this.toggleOpen(event, eventDetails);
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
Dropdown.prototype.focusNextOnOpen = function focusNextOnOpen() {
|
|
212
|
-
var menu = this.menu;
|
|
213
|
-
|
|
214
|
-
if (!menu.focusNext) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (this.lastOpenEventType === 'keydown' || this.props.role === 'menuitem') {
|
|
219
|
-
menu.focusNext();
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
Dropdown.prototype.focus = function focus() {
|
|
224
|
-
var toggle = ReactDOM.findDOMNode(this.toggle);
|
|
225
|
-
|
|
226
|
-
if (toggle && toggle.focus) {
|
|
227
|
-
toggle.focus();
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
Dropdown.prototype.renderToggle = function renderToggle(child, props) {
|
|
235
|
+
Dropdown.prototype.renderMenu = function renderMenu(child, _ref) {
|
|
232
236
|
var _this2 = this;
|
|
233
237
|
|
|
238
|
+
var id = _ref.id,
|
|
239
|
+
onSelect = _ref.onSelect,
|
|
240
|
+
rootCloseEvent = _ref.rootCloseEvent,
|
|
241
|
+
props = _objectWithoutProperties(_ref, ['id', 'onSelect', 'rootCloseEvent']);
|
|
242
|
+
|
|
234
243
|
var ref = function ref(c) {
|
|
235
|
-
_this2.
|
|
244
|
+
_this2.menu = c;
|
|
236
245
|
};
|
|
237
246
|
|
|
238
247
|
if (typeof child.ref === 'string') {
|
|
239
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'String refs are not supported on `<Dropdown.
|
|
248
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'String refs are not supported on `<Dropdown.Menu>` components. ' + 'To apply a ref to the component use the callback signature:\n\n ' + 'https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute') : void 0;
|
|
240
249
|
} else {
|
|
241
250
|
ref = createChainedFunction(child.ref, ref);
|
|
242
251
|
}
|
|
243
252
|
|
|
244
253
|
return cloneElement(child, _extends({}, props, {
|
|
245
254
|
ref: ref,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
255
|
+
labelledBy: id,
|
|
256
|
+
bsClass: prefix(props, 'menu'),
|
|
257
|
+
onClose: createChainedFunction(child.props.onClose, this.handleClose),
|
|
258
|
+
onSelect: createChainedFunction(child.props.onSelect, onSelect, function (key, event) {
|
|
259
|
+
return _this2.handleClose(event, { source: 'select' });
|
|
260
|
+
}),
|
|
261
|
+
rootCloseEvent: rootCloseEvent
|
|
249
262
|
}));
|
|
250
263
|
};
|
|
251
264
|
|
|
252
|
-
Dropdown.prototype.
|
|
265
|
+
Dropdown.prototype.renderToggle = function renderToggle(child, props) {
|
|
253
266
|
var _this3 = this;
|
|
254
267
|
|
|
255
|
-
var id = _ref.id,
|
|
256
|
-
onSelect = _ref.onSelect,
|
|
257
|
-
rootCloseEvent = _ref.rootCloseEvent,
|
|
258
|
-
props = _objectWithoutProperties(_ref, ['id', 'onSelect', 'rootCloseEvent']);
|
|
259
|
-
|
|
260
268
|
var ref = function ref(c) {
|
|
261
|
-
_this3.
|
|
269
|
+
_this3.toggle = c;
|
|
262
270
|
};
|
|
263
271
|
|
|
264
272
|
if (typeof child.ref === 'string') {
|
|
265
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'String refs are not supported on `<Dropdown.
|
|
273
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'String refs are not supported on `<Dropdown.Toggle>` components. ' + 'To apply a ref to the component use the callback signature:\n\n ' + 'https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute') : void 0;
|
|
266
274
|
} else {
|
|
267
275
|
ref = createChainedFunction(child.ref, ref);
|
|
268
276
|
}
|
|
269
277
|
|
|
270
278
|
return cloneElement(child, _extends({}, props, {
|
|
271
279
|
ref: ref,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
onSelect: createChainedFunction(child.props.onSelect, onSelect, function (key, event) {
|
|
276
|
-
return _this3.handleClose(event, { source: 'select' });
|
|
277
|
-
}),
|
|
278
|
-
rootCloseEvent: rootCloseEvent
|
|
280
|
+
bsClass: prefix(props, 'toggle'),
|
|
281
|
+
onClick: createChainedFunction(child.props.onClick, this.handleClick),
|
|
282
|
+
onKeyDown: createChainedFunction(child.props.onKeyDown, this.handleKeyDown)
|
|
279
283
|
}));
|
|
280
284
|
};
|
|
281
285
|
|
|
@@ -312,18 +316,25 @@ var Dropdown = function (_React$Component) {
|
|
|
312
316
|
|
|
313
317
|
return React.createElement(
|
|
314
318
|
Component,
|
|
315
|
-
_extends({}, props, {
|
|
316
|
-
className: classNames(className, classes)
|
|
317
|
-
}),
|
|
319
|
+
_extends({}, props, { className: classNames(className, classes) }),
|
|
318
320
|
ValidComponentChildren.map(children, function (child) {
|
|
319
321
|
switch (child.props.bsRole) {
|
|
320
322
|
case TOGGLE_ROLE:
|
|
321
323
|
return _this4.renderToggle(child, {
|
|
322
|
-
id: id,
|
|
324
|
+
id: id,
|
|
325
|
+
disabled: disabled,
|
|
326
|
+
open: open,
|
|
327
|
+
role: role,
|
|
328
|
+
bsClass: bsClass
|
|
323
329
|
});
|
|
324
330
|
case MENU_ROLE:
|
|
325
331
|
return _this4.renderMenu(child, {
|
|
326
|
-
id: id,
|
|
332
|
+
id: id,
|
|
333
|
+
open: open,
|
|
334
|
+
pullRight: pullRight,
|
|
335
|
+
bsClass: bsClass,
|
|
336
|
+
onSelect: onSelect,
|
|
337
|
+
rootCloseEvent: rootCloseEvent
|
|
327
338
|
});
|
|
328
339
|
default:
|
|
329
340
|
return child;
|
package/es/DropdownButton.js
CHANGED
|
@@ -47,16 +47,10 @@ var DropdownButton = function (_React$Component) {
|
|
|
47
47
|
|
|
48
48
|
return React.createElement(
|
|
49
49
|
Dropdown,
|
|
50
|
-
_extends({}, dropdownProps, {
|
|
51
|
-
bsSize: bsSize,
|
|
52
|
-
bsStyle: bsStyle
|
|
53
|
-
}),
|
|
50
|
+
_extends({}, dropdownProps, { bsSize: bsSize, bsStyle: bsStyle }),
|
|
54
51
|
React.createElement(
|
|
55
52
|
Dropdown.Toggle,
|
|
56
|
-
_extends({}, toggleProps, {
|
|
57
|
-
bsSize: bsSize,
|
|
58
|
-
bsStyle: bsStyle
|
|
59
|
-
}),
|
|
53
|
+
_extends({}, toggleProps, { bsSize: bsSize, bsStyle: bsStyle }),
|
|
60
54
|
title
|
|
61
55
|
),
|
|
62
56
|
React.createElement(
|
package/es/DropdownMenu.js
CHANGED
|
@@ -42,26 +42,13 @@ var DropdownMenu = function (_React$Component) {
|
|
|
42
42
|
return _this;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
DropdownMenu.prototype.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
|
|
50
|
-
switch (event.keyCode) {
|
|
51
|
-
case keycode.codes.down:
|
|
52
|
-
this.focusNext();
|
|
53
|
-
event.preventDefault();
|
|
54
|
-
break;
|
|
55
|
-
case keycode.codes.up:
|
|
56
|
-
this.focusPrevious();
|
|
57
|
-
event.preventDefault();
|
|
58
|
-
break;
|
|
59
|
-
case keycode.codes.esc:
|
|
60
|
-
case keycode.codes.tab:
|
|
61
|
-
this.props.onClose(event, { source: 'keydown' });
|
|
62
|
-
break;
|
|
63
|
-
default:
|
|
45
|
+
DropdownMenu.prototype.getFocusableMenuItems = function getFocusableMenuItems() {
|
|
46
|
+
var node = ReactDOM.findDOMNode(this);
|
|
47
|
+
if (!node) {
|
|
48
|
+
return [];
|
|
64
49
|
}
|
|
50
|
+
|
|
51
|
+
return _Array$from(node.querySelectorAll('[tabIndex="-1"]'));
|
|
65
52
|
};
|
|
66
53
|
|
|
67
54
|
DropdownMenu.prototype.getItemsAndActiveIndex = function getItemsAndActiveIndex() {
|
|
@@ -71,15 +58,6 @@ var DropdownMenu = function (_React$Component) {
|
|
|
71
58
|
return { items: items, activeIndex: activeIndex };
|
|
72
59
|
};
|
|
73
60
|
|
|
74
|
-
DropdownMenu.prototype.getFocusableMenuItems = function getFocusableMenuItems() {
|
|
75
|
-
var node = ReactDOM.findDOMNode(this);
|
|
76
|
-
if (!node) {
|
|
77
|
-
return [];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return _Array$from(node.querySelectorAll('[tabIndex="-1"]'));
|
|
81
|
-
};
|
|
82
|
-
|
|
83
61
|
DropdownMenu.prototype.focusNext = function focusNext() {
|
|
84
62
|
var _getItemsAndActiveInd = this.getItemsAndActiveIndex(),
|
|
85
63
|
items = _getItemsAndActiveInd.items,
|
|
@@ -106,6 +84,28 @@ var DropdownMenu = function (_React$Component) {
|
|
|
106
84
|
items[prevIndex].focus();
|
|
107
85
|
};
|
|
108
86
|
|
|
87
|
+
DropdownMenu.prototype.handleKeyDown = function handleKeyDown(event) {
|
|
88
|
+
switch (event.keyCode) {
|
|
89
|
+
case keycode.codes.down:
|
|
90
|
+
this.focusNext();
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
break;
|
|
93
|
+
case keycode.codes.up:
|
|
94
|
+
this.focusPrevious();
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
break;
|
|
97
|
+
case keycode.codes.esc:
|
|
98
|
+
case keycode.codes.tab:
|
|
99
|
+
this.props.onClose(event, { source: 'keydown' });
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
DropdownMenu.prototype.handleRootClose = function handleRootClose(event) {
|
|
106
|
+
this.props.onClose(event, { source: 'rootClose' });
|
|
107
|
+
};
|
|
108
|
+
|
|
109
109
|
DropdownMenu.prototype.render = function render() {
|
|
110
110
|
var _extends2,
|
|
111
111
|
_this2 = this;
|
package/es/Fade.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import _extends from 'babel-runtime/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
2
3
|
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
|
3
4
|
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
4
5
|
import _inherits from 'babel-runtime/helpers/inherits';
|
|
6
|
+
|
|
7
|
+
var _fadeStyles;
|
|
8
|
+
|
|
5
9
|
import classNames from 'classnames';
|
|
6
10
|
import React from 'react';
|
|
7
11
|
import PropTypes from 'prop-types';
|
|
8
|
-
import Transition from 'react-
|
|
12
|
+
import Transition, { ENTERED, ENTERING } from 'react-transition-group/Transition';
|
|
9
13
|
|
|
10
14
|
var propTypes = {
|
|
11
15
|
/**
|
|
12
16
|
* Show the component; triggers the fade in or fade out animation
|
|
13
17
|
*/
|
|
14
|
-
|
|
18
|
+
in: PropTypes.bool,
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* Wait until the first "enter" transition to mount the component (add it to the DOM)
|
|
@@ -27,7 +31,7 @@ var propTypes = {
|
|
|
27
31
|
* Run the fade in animation when the component mounts, if it is initially
|
|
28
32
|
* shown
|
|
29
33
|
*/
|
|
30
|
-
|
|
34
|
+
appear: PropTypes.bool,
|
|
31
35
|
|
|
32
36
|
/**
|
|
33
37
|
* Duration of the fade animation in milliseconds, to ensure that finishing
|
|
@@ -63,13 +67,15 @@ var propTypes = {
|
|
|
63
67
|
};
|
|
64
68
|
|
|
65
69
|
var defaultProps = {
|
|
66
|
-
|
|
70
|
+
in: false,
|
|
67
71
|
timeout: 300,
|
|
68
72
|
mountOnEnter: false,
|
|
69
73
|
unmountOnExit: false,
|
|
70
|
-
|
|
74
|
+
appear: false
|
|
71
75
|
};
|
|
72
76
|
|
|
77
|
+
var fadeStyles = (_fadeStyles = {}, _fadeStyles[ENTERING] = 'in', _fadeStyles[ENTERED] = 'in', _fadeStyles);
|
|
78
|
+
|
|
73
79
|
var Fade = function (_React$Component) {
|
|
74
80
|
_inherits(Fade, _React$Component);
|
|
75
81
|
|
|
@@ -80,11 +86,20 @@ var Fade = function (_React$Component) {
|
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
Fade.prototype.render = function render() {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
var _props = this.props,
|
|
90
|
+
className = _props.className,
|
|
91
|
+
children = _props.children,
|
|
92
|
+
props = _objectWithoutProperties(_props, ['className', 'children']);
|
|
93
|
+
|
|
94
|
+
return React.createElement(
|
|
95
|
+
Transition,
|
|
96
|
+
props,
|
|
97
|
+
function (status, innerProps) {
|
|
98
|
+
return React.cloneElement(children, _extends({}, innerProps, {
|
|
99
|
+
className: classNames('fade', className, children.props.className, fadeStyles[status])
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
);
|
|
88
103
|
};
|
|
89
104
|
|
|
90
105
|
return Fade;
|
package/es/Form.js
CHANGED
|
@@ -51,9 +51,7 @@ var Form = function (_React$Component) {
|
|
|
51
51
|
classes.push(prefix(bsProps, 'inline'));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
return React.createElement(Component, _extends({}, elementProps, {
|
|
55
|
-
className: classNames(className, classes)
|
|
56
|
-
}));
|
|
54
|
+
return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
57
55
|
};
|
|
58
56
|
|
|
59
57
|
return Form;
|
package/es/FormControl.js
CHANGED
|
@@ -11,9 +11,8 @@ import warning from 'warning';
|
|
|
11
11
|
|
|
12
12
|
import FormControlFeedback from './FormControlFeedback';
|
|
13
13
|
import FormControlStatic from './FormControlStatic';
|
|
14
|
-
import { bsClass, getClassSet, splitBsProps, bsSizes } from './utils/bootstrapUtils';
|
|
14
|
+
import { prefix, bsClass, getClassSet, splitBsProps, bsSizes } from './utils/bootstrapUtils';
|
|
15
15
|
import { SIZE_MAP, Size } from './utils/StyleConfig';
|
|
16
|
-
import { prefix } from './utils/bootstrapUtils';
|
|
17
16
|
|
|
18
17
|
var propTypes = {
|
|
19
18
|
componentClass: elementType,
|
package/es/FormControlStatic.js
CHANGED
|
@@ -38,9 +38,7 @@ var FormControlStatic = function (_React$Component) {
|
|
|
38
38
|
|
|
39
39
|
var classes = getClassSet(bsProps);
|
|
40
40
|
|
|
41
|
-
return React.createElement(Component, _extends({}, elementProps, {
|
|
42
|
-
className: classNames(className, classes)
|
|
43
|
-
}));
|
|
41
|
+
return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
44
42
|
};
|
|
45
43
|
|
|
46
44
|
return FormControlStatic;
|
package/es/FormGroup.js
CHANGED
|
@@ -74,9 +74,7 @@ var FormGroup = function (_React$Component) {
|
|
|
74
74
|
|
|
75
75
|
return React.createElement(
|
|
76
76
|
'div',
|
|
77
|
-
_extends({}, elementProps, {
|
|
78
|
-
className: classNames(className, classes)
|
|
79
|
-
}),
|
|
77
|
+
_extends({}, elementProps, { className: classNames(className, classes) }),
|
|
80
78
|
children
|
|
81
79
|
);
|
|
82
80
|
};
|
package/es/Glyphicon.js
CHANGED
|
@@ -39,9 +39,7 @@ var Glyphicon = function (_React$Component) {
|
|
|
39
39
|
|
|
40
40
|
var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, glyph)] = true, _extends2));
|
|
41
41
|
|
|
42
|
-
return React.createElement('span', _extends({}, elementProps, {
|
|
43
|
-
className: classNames(className, classes)
|
|
44
|
-
}));
|
|
42
|
+
return React.createElement('span', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
45
43
|
};
|
|
46
44
|
|
|
47
45
|
return Glyphicon;
|
package/es/Grid.js
CHANGED
|
@@ -50,9 +50,7 @@ var Grid = function (_React$Component) {
|
|
|
50
50
|
|
|
51
51
|
var classes = prefix(bsProps, fluid && 'fluid');
|
|
52
52
|
|
|
53
|
-
return React.createElement(Component, _extends({}, elementProps, {
|
|
54
|
-
className: classNames(className, classes)
|
|
55
|
-
}));
|
|
53
|
+
return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
56
54
|
};
|
|
57
55
|
|
|
58
56
|
return Grid;
|
package/es/HelpBlock.js
CHANGED
|
@@ -28,9 +28,7 @@ var HelpBlock = function (_React$Component) {
|
|
|
28
28
|
|
|
29
29
|
var classes = getClassSet(bsProps);
|
|
30
30
|
|
|
31
|
-
return React.createElement('span', _extends({}, elementProps, {
|
|
32
|
-
className: classNames(className, classes)
|
|
33
|
-
}));
|
|
31
|
+
return React.createElement('span', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
return HelpBlock;
|
package/es/InputGroup.js
CHANGED
|
@@ -31,9 +31,7 @@ var InputGroup = function (_React$Component) {
|
|
|
31
31
|
|
|
32
32
|
var classes = getClassSet(bsProps);
|
|
33
33
|
|
|
34
|
-
return React.createElement('span', _extends({}, elementProps, {
|
|
35
|
-
className: classNames(className, classes)
|
|
36
|
-
}));
|
|
34
|
+
return React.createElement('span', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
37
35
|
};
|
|
38
36
|
|
|
39
37
|
return InputGroup;
|
package/es/InputGroupAddon.js
CHANGED
|
@@ -28,9 +28,7 @@ var InputGroupAddon = function (_React$Component) {
|
|
|
28
28
|
|
|
29
29
|
var classes = getClassSet(bsProps);
|
|
30
30
|
|
|
31
|
-
return React.createElement('span', _extends({}, elementProps, {
|
|
32
|
-
className: classNames(className, classes)
|
|
33
|
-
}));
|
|
31
|
+
return React.createElement('span', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
return InputGroupAddon;
|
package/es/InputGroupButton.js
CHANGED
|
@@ -28,9 +28,7 @@ var InputGroupButton = function (_React$Component) {
|
|
|
28
28
|
|
|
29
29
|
var classes = getClassSet(bsProps);
|
|
30
30
|
|
|
31
|
-
return React.createElement('span', _extends({}, elementProps, {
|
|
32
|
-
className: classNames(className, classes)
|
|
33
|
-
}));
|
|
31
|
+
return React.createElement('span', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
return InputGroupButton;
|
package/es/Jumbotron.js
CHANGED
|
@@ -38,9 +38,7 @@ var Jumbotron = function (_React$Component) {
|
|
|
38
38
|
|
|
39
39
|
var classes = getClassSet(bsProps);
|
|
40
40
|
|
|
41
|
-
return React.createElement(Component, _extends({}, elementProps, {
|
|
42
|
-
className: classNames(className, classes)
|
|
43
|
-
}));
|
|
41
|
+
return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
44
42
|
};
|
|
45
43
|
|
|
46
44
|
return Jumbotron;
|
package/es/Label.js
CHANGED
|
@@ -53,9 +53,7 @@ var Label = function (_React$Component) {
|
|
|
53
53
|
|
|
54
54
|
return React.createElement(
|
|
55
55
|
'span',
|
|
56
|
-
_extends({}, elementProps, {
|
|
57
|
-
className: classNames(className, classes)
|
|
58
|
-
}),
|
|
56
|
+
_extends({}, elementProps, { className: classNames(className, classes) }),
|
|
59
57
|
children
|
|
60
58
|
);
|
|
61
59
|
};
|
package/es/ListGroup.js
CHANGED
|
@@ -65,9 +65,7 @@ var ListGroup = function (_React$Component) {
|
|
|
65
65
|
|
|
66
66
|
return React.createElement(
|
|
67
67
|
Component,
|
|
68
|
-
_extends({}, elementProps, {
|
|
69
|
-
className: classNames(className, classes)
|
|
70
|
-
}),
|
|
68
|
+
_extends({}, elementProps, { className: classNames(className, classes) }),
|
|
71
69
|
useListItem ? ValidComponentChildren.map(children, function (child) {
|
|
72
70
|
return cloneElement(child, { listItem: true });
|
|
73
71
|
}) : children
|
package/es/Media.js
CHANGED
|
@@ -44,9 +44,7 @@ var Media = function (_React$Component) {
|
|
|
44
44
|
|
|
45
45
|
var classes = getClassSet(bsProps);
|
|
46
46
|
|
|
47
|
-
return React.createElement(Component, _extends({}, elementProps, {
|
|
48
|
-
className: classNames(className, classes)
|
|
49
|
-
}));
|
|
47
|
+
return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
50
48
|
};
|
|
51
49
|
|
|
52
50
|
return Media;
|
package/es/MediaBody.js
CHANGED
|
@@ -5,11 +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 PropTypes from 'prop-types';
|
|
8
9
|
import elementType from 'prop-types-extra/lib/elementType';
|
|
9
10
|
|
|
10
|
-
import
|
|
11
|
+
import Media from './Media';
|
|
12
|
+
import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
11
13
|
|
|
12
14
|
var propTypes = {
|
|
15
|
+
/**
|
|
16
|
+
* Align the media to the top, middle, or bottom of the media object.
|
|
17
|
+
*/
|
|
18
|
+
align: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
19
|
+
|
|
13
20
|
componentClass: elementType
|
|
14
21
|
};
|
|
15
22
|
|
|
@@ -29,8 +36,9 @@ var MediaBody = function (_React$Component) {
|
|
|
29
36
|
MediaBody.prototype.render = function render() {
|
|
30
37
|
var _props = this.props,
|
|
31
38
|
Component = _props.componentClass,
|
|
39
|
+
align = _props.align,
|
|
32
40
|
className = _props.className,
|
|
33
|
-
props = _objectWithoutProperties(_props, ['componentClass', 'className']);
|
|
41
|
+
props = _objectWithoutProperties(_props, ['componentClass', 'align', 'className']);
|
|
34
42
|
|
|
35
43
|
var _splitBsProps = splitBsProps(props),
|
|
36
44
|
bsProps = _splitBsProps[0],
|
|
@@ -38,9 +46,12 @@ var MediaBody = function (_React$Component) {
|
|
|
38
46
|
|
|
39
47
|
var classes = getClassSet(bsProps);
|
|
40
48
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
if (align) {
|
|
50
|
+
// The class is e.g. `media-top`, not `media-left-top`.
|
|
51
|
+
classes[prefix(Media.defaultProps, align)] = true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
44
55
|
};
|
|
45
56
|
|
|
46
57
|
return MediaBody;
|
package/es/MediaHeading.js
CHANGED
|
@@ -38,9 +38,7 @@ var MediaHeading = function (_React$Component) {
|
|
|
38
38
|
|
|
39
39
|
var classes = getClassSet(bsProps);
|
|
40
40
|
|
|
41
|
-
return React.createElement(Component, _extends({}, elementProps, {
|
|
42
|
-
className: classNames(className, classes)
|
|
43
|
-
}));
|
|
41
|
+
return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
44
42
|
};
|
|
45
43
|
|
|
46
44
|
return MediaHeading;
|
package/es/MediaLeft.js
CHANGED
|
@@ -43,9 +43,7 @@ var MediaLeft = function (_React$Component) {
|
|
|
43
43
|
classes[prefix(Media.defaultProps, align)] = true;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
return React.createElement('div', _extends({}, elementProps, {
|
|
47
|
-
className: classNames(className, classes)
|
|
48
|
-
}));
|
|
46
|
+
return React.createElement('div', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
49
47
|
};
|
|
50
48
|
|
|
51
49
|
return MediaLeft;
|
package/es/MediaList.js
CHANGED
|
@@ -28,9 +28,7 @@ var MediaList = function (_React$Component) {
|
|
|
28
28
|
|
|
29
29
|
var classes = getClassSet(bsProps);
|
|
30
30
|
|
|
31
|
-
return React.createElement('ul', _extends({}, elementProps, {
|
|
32
|
-
className: classNames(className, classes)
|
|
33
|
-
}));
|
|
31
|
+
return React.createElement('ul', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
return MediaList;
|
package/es/MediaListItem.js
CHANGED
|
@@ -28,9 +28,7 @@ var MediaListItem = function (_React$Component) {
|
|
|
28
28
|
|
|
29
29
|
var classes = getClassSet(bsProps);
|
|
30
30
|
|
|
31
|
-
return React.createElement('li', _extends({}, elementProps, {
|
|
32
|
-
className: classNames(className, classes)
|
|
33
|
-
}));
|
|
31
|
+
return React.createElement('li', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
return MediaListItem;
|
package/es/MediaRight.js
CHANGED
|
@@ -43,9 +43,7 @@ var MediaRight = function (_React$Component) {
|
|
|
43
43
|
classes[prefix(Media.defaultProps, align)] = true;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
return React.createElement('div', _extends({}, elementProps, {
|
|
47
|
-
className: classNames(className, classes)
|
|
48
|
-
}));
|
|
46
|
+
return React.createElement('div', _extends({}, elementProps, { className: classNames(className, classes) }));
|
|
49
47
|
};
|
|
50
48
|
|
|
51
49
|
return MediaRight;
|