react-bootstrap 0.31.3 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/README.md +1 -0
- package/dist/react-bootstrap.js +14493 -17076
- package/dist/react-bootstrap.min.js +18479 -16
- package/es/Alert.js +1 -4
- package/es/Badge.js +1 -3
- package/es/ButtonGroup.js +1 -3
- package/es/Carousel.js +79 -79
- package/es/CarouselCaption.js +1 -3
- package/es/CarouselItem.js +3 -9
- package/es/Checkbox.js +7 -1
- package/es/Clearfix.js +1 -3
- package/es/CloseButton.js +1 -5
- package/es/Col.js +1 -3
- package/es/Collapse.js +58 -65
- package/es/Dropdown.js +66 -55
- package/es/DropdownButton.js +2 -8
- package/es/DropdownMenu.js +28 -28
- package/es/Fade.js +25 -10
- package/es/Form.js +1 -3
- package/es/FormControl.js +1 -2
- package/es/FormControlStatic.js +1 -3
- package/es/FormGroup.js +1 -3
- package/es/Glyphicon.js +1 -3
- package/es/Grid.js +1 -3
- package/es/HelpBlock.js +1 -3
- package/es/InputGroup.js +1 -3
- package/es/InputGroupAddon.js +1 -3
- package/es/InputGroupButton.js +1 -3
- package/es/Jumbotron.js +1 -3
- package/es/Label.js +1 -3
- package/es/ListGroup.js +1 -3
- package/es/Media.js +1 -3
- package/es/MediaBody.js +16 -5
- package/es/MediaHeading.js +1 -3
- package/es/MediaLeft.js +1 -3
- package/es/MediaList.js +1 -3
- package/es/MediaListItem.js +1 -3
- package/es/MediaRight.js +1 -3
- package/es/Modal.js +30 -19
- package/es/ModalBody.js +1 -3
- package/es/ModalFooter.js +1 -3
- package/es/ModalHeader.js +2 -4
- package/es/ModalTitle.js +1 -3
- package/es/Nav.js +44 -44
- package/es/NavDropdown.js +2 -0
- package/es/NavItem.js +5 -4
- package/es/Navbar.js +5 -7
- package/es/Overlay.js +1 -3
- package/es/OverlayTrigger.js +43 -43
- package/es/PageHeader.js +1 -3
- package/es/Pager.js +1 -3
- package/es/PagerItem.js +1 -4
- package/es/Pagination.js +15 -224
- package/es/PaginationItem.js +102 -0
- package/es/Panel.js +114 -173
- package/es/PanelBody.js +84 -0
- package/es/PanelCollapse.js +94 -0
- package/es/PanelFooter.js +53 -0
- package/es/PanelGroup.js +95 -52
- package/es/PanelHeading.js +75 -0
- package/es/PanelTitle.js +83 -0
- package/es/PanelToggle.js +94 -0
- package/es/ProgressBar.js +12 -8
- package/es/Radio.js +7 -1
- package/es/Row.js +1 -3
- package/es/SplitButton.js +1 -4
- package/es/SplitToggle.js +1 -4
- package/es/TabContent.js +7 -7
- package/es/TabPane.js +18 -18
- package/es/Table.js +1 -3
- package/es/Tabs.js +4 -10
- package/es/Thumbnail.js +3 -3
- package/es/ToggleButton.js +1 -4
- package/es/Well.js +1 -3
- package/es/index.js +0 -2
- package/es/utils/PropTypes.js +26 -4
- package/es/utils/ValidComponentChildren.js +1 -1
- package/es/utils/bootstrapUtils.js +5 -3
- package/lib/Accordion.js +9 -9
- package/lib/Alert.js +14 -17
- package/lib/Badge.js +12 -14
- package/lib/Breadcrumb.js +10 -10
- package/lib/BreadcrumbItem.js +14 -14
- package/lib/Button.js +20 -20
- package/lib/ButtonGroup.js +12 -14
- package/lib/ButtonToolbar.js +9 -9
- package/lib/Carousel.js +121 -121
- package/lib/CarouselCaption.js +9 -11
- package/lib/CarouselItem.js +17 -22
- package/lib/Checkbox.js +25 -21
- package/lib/Clearfix.js +14 -16
- package/lib/CloseButton.js +12 -16
- package/lib/Col.js +29 -31
- package/lib/Collapse.js +84 -92
- package/lib/ControlLabel.js +14 -14
- package/lib/Dropdown.js +106 -95
- package/lib/DropdownButton.js +22 -28
- package/lib/DropdownMenu.js +51 -51
- package/lib/DropdownToggle.js +16 -16
- package/lib/Fade.js +43 -25
- package/lib/Form.js +11 -13
- package/lib/FormControl.js +17 -17
- package/lib/FormControlFeedback.js +13 -13
- package/lib/FormControlStatic.js +9 -11
- package/lib/FormGroup.js +14 -16
- package/lib/Glyphicon.js +10 -12
- package/lib/Grid.js +10 -12
- package/lib/HelpBlock.js +8 -10
- package/lib/Image.js +13 -13
- package/lib/InputGroup.js +10 -12
- package/lib/InputGroupAddon.js +8 -10
- package/lib/InputGroupButton.js +8 -10
- package/lib/Jumbotron.js +9 -11
- package/lib/Label.js +11 -13
- package/lib/ListGroup.js +15 -17
- package/lib/ListGroupItem.js +22 -22
- package/lib/Media.js +15 -17
- package/lib/MediaBody.js +28 -11
- package/lib/MediaHeading.js +9 -11
- package/lib/MediaLeft.js +10 -12
- package/lib/MediaList.js +8 -10
- package/lib/MediaListItem.js +8 -10
- package/lib/MediaRight.js +10 -12
- package/lib/MenuItem.js +23 -23
- package/lib/Modal.js +80 -69
- package/lib/ModalBody.js +9 -11
- package/lib/ModalDialog.js +16 -16
- package/lib/ModalFooter.js +9 -11
- package/lib/ModalHeader.js +20 -22
- package/lib/ModalTitle.js +9 -11
- package/lib/Nav.js +81 -81
- package/lib/NavDropdown.js +27 -25
- package/lib/NavItem.js +23 -22
- package/lib/Navbar.js +46 -48
- package/lib/NavbarBrand.js +14 -14
- package/lib/NavbarCollapse.js +14 -14
- package/lib/NavbarHeader.js +10 -10
- package/lib/NavbarToggle.js +22 -22
- package/lib/Overlay.js +25 -27
- package/lib/OverlayTrigger.js +79 -79
- package/lib/PageHeader.js +10 -12
- package/lib/PageItem.js +2 -2
- package/lib/Pager.js +13 -15
- package/lib/PagerItem.js +18 -21
- package/lib/Pagination.js +25 -240
- package/lib/PaginationItem.js +135 -0
- package/lib/Panel.js +142 -180
- package/lib/PanelBody.js +114 -0
- package/lib/PanelCollapse.js +120 -0
- package/lib/PanelFooter.js +80 -0
- package/lib/PanelGroup.js +111 -70
- package/lib/PanelHeading.js +107 -0
- package/lib/PanelTitle.js +118 -0
- package/lib/PanelToggle.js +130 -0
- package/lib/Popover.js +22 -22
- package/lib/ProgressBar.js +39 -35
- package/lib/Radio.js +25 -21
- package/lib/ResponsiveEmbed.js +17 -17
- package/lib/Row.js +9 -11
- package/lib/SafeAnchor.js +17 -17
- package/lib/SplitButton.js +26 -29
- package/lib/SplitToggle.js +8 -11
- package/lib/Tab.js +15 -15
- package/lib/TabContainer.js +17 -17
- package/lib/TabContent.js +31 -31
- package/lib/TabPane.js +59 -59
- package/lib/Table.js +15 -17
- package/lib/Tabs.js +29 -35
- package/lib/Thumbnail.js +18 -20
- package/lib/ToggleButton.js +17 -20
- package/lib/ToggleButtonGroup.js +20 -20
- package/lib/Tooltip.js +20 -20
- package/lib/Well.js +8 -10
- package/lib/index.js +74 -79
- package/lib/utils/PropTypes.js +35 -9
- package/lib/utils/ValidComponentChildren.js +19 -19
- package/lib/utils/bootstrapUtils.js +13 -11
- package/lib/utils/capitalize.js +1 -1
- package/lib/utils/createChainedFunction.js +1 -1
- package/lib/utils/deprecationWarning.js +7 -7
- package/lib/utils/index.js +4 -4
- package/lib/utils/splitComponentProps.js +3 -3
- package/package.json +54 -64
- package/dist/react-bootstrap.min.js.map +0 -1
- package/es/PaginationButton.js +0 -98
- package/es/utils/TransitionEvents.js +0 -109
- package/lib/PaginationButton.js +0 -137
- package/lib/utils/TransitionEvents.js +0 -113
package/lib/Modal.js
CHANGED
|
@@ -102,38 +102,38 @@ var _splitComponentProps3 = _interopRequireDefault(_splitComponentProps2);
|
|
|
102
102
|
|
|
103
103
|
var _StyleConfig = require('./utils/StyleConfig');
|
|
104
104
|
|
|
105
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
105
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
106
106
|
|
|
107
|
-
var propTypes = (0, _extends3
|
|
107
|
+
var propTypes = (0, _extends3.default)({}, _Modal2.default.propTypes, _ModalDialog2.default.propTypes, {
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Include a backdrop component. Specify 'static' for a backdrop that doesn't
|
|
111
111
|
* trigger an "onHide" when clicked.
|
|
112
112
|
*/
|
|
113
|
-
backdrop: _propTypes2
|
|
113
|
+
backdrop: _propTypes2.default.oneOf(['static', true, false]),
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* Add an optional extra class name to .modal-backdrop
|
|
117
117
|
* It could end up looking like class="modal-backdrop foo-modal-backdrop in".
|
|
118
118
|
*/
|
|
119
|
-
backdropClassName: _propTypes2
|
|
119
|
+
backdropClassName: _propTypes2.default.string,
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* Close the modal when escape key is pressed
|
|
123
123
|
*/
|
|
124
|
-
keyboard: _propTypes2
|
|
124
|
+
keyboard: _propTypes2.default.bool,
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
127
|
* Open and close the Modal with a slide and fade animation.
|
|
128
128
|
*/
|
|
129
|
-
animation: _propTypes2
|
|
129
|
+
animation: _propTypes2.default.bool,
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* A Component type that provides the modal content Markup. This is a useful
|
|
133
133
|
* prop when you want to use your own styles and markup to create a custom
|
|
134
134
|
* modal component.
|
|
135
135
|
*/
|
|
136
|
-
dialogComponentClass: _elementType2
|
|
136
|
+
dialogComponentClass: _elementType2.default,
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* When `true` The modal will automatically shift focus to itself when it
|
|
@@ -141,91 +141,103 @@ var propTypes = (0, _extends3['default'])({}, _Modal2['default'].propTypes, _Mod
|
|
|
141
141
|
* Generally this should never be set to false as it makes the Modal less
|
|
142
142
|
* accessible to assistive technologies, like screen-readers.
|
|
143
143
|
*/
|
|
144
|
-
autoFocus: _propTypes2
|
|
144
|
+
autoFocus: _propTypes2.default.bool,
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* When `true` The modal will prevent focus from leaving the Modal while
|
|
148
148
|
* open. Consider leaving the default value here, as it is necessary to make
|
|
149
149
|
* the Modal work well with assistive technologies, such as screen readers.
|
|
150
150
|
*/
|
|
151
|
-
enforceFocus: _propTypes2
|
|
151
|
+
enforceFocus: _propTypes2.default.bool,
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
154
|
* When `true` The modal will restore focus to previously focused element once
|
|
155
155
|
* modal is hidden
|
|
156
156
|
*/
|
|
157
|
-
restoreFocus: _propTypes2
|
|
157
|
+
restoreFocus: _propTypes2.default.bool,
|
|
158
158
|
|
|
159
159
|
/**
|
|
160
160
|
* When `true` The modal will show itself.
|
|
161
161
|
*/
|
|
162
|
-
show: _propTypes2
|
|
162
|
+
show: _propTypes2.default.bool,
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
* A callback fired when the header closeButton or non-static backdrop is
|
|
166
166
|
* clicked. Required if either are specified.
|
|
167
167
|
*/
|
|
168
|
-
onHide: _propTypes2
|
|
168
|
+
onHide: _propTypes2.default.func,
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
171
|
* Callback fired before the Modal transitions in
|
|
172
172
|
*/
|
|
173
|
-
onEnter: _propTypes2
|
|
173
|
+
onEnter: _propTypes2.default.func,
|
|
174
174
|
|
|
175
175
|
/**
|
|
176
176
|
* Callback fired as the Modal begins to transition in
|
|
177
177
|
*/
|
|
178
|
-
onEntering: _propTypes2
|
|
178
|
+
onEntering: _propTypes2.default.func,
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
181
|
* Callback fired after the Modal finishes transitioning in
|
|
182
182
|
*/
|
|
183
|
-
onEntered: _propTypes2
|
|
183
|
+
onEntered: _propTypes2.default.func,
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
186
|
* Callback fired right before the Modal transitions out
|
|
187
187
|
*/
|
|
188
|
-
onExit: _propTypes2
|
|
188
|
+
onExit: _propTypes2.default.func,
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
191
|
* Callback fired as the Modal begins to transition out
|
|
192
192
|
*/
|
|
193
|
-
onExiting: _propTypes2
|
|
193
|
+
onExiting: _propTypes2.default.func,
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* Callback fired after the Modal finishes transitioning out
|
|
197
197
|
*/
|
|
198
|
-
onExited: _propTypes2
|
|
198
|
+
onExited: _propTypes2.default.func,
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* @private
|
|
202
202
|
*/
|
|
203
|
-
container: _Modal2
|
|
203
|
+
container: _Modal2.default.propTypes.container
|
|
204
204
|
});
|
|
205
205
|
|
|
206
|
-
var defaultProps = (0, _extends3
|
|
206
|
+
var defaultProps = (0, _extends3.default)({}, _Modal2.default.defaultProps, {
|
|
207
207
|
animation: true,
|
|
208
|
-
dialogComponentClass: _ModalDialog2
|
|
208
|
+
dialogComponentClass: _ModalDialog2.default
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
var childContextTypes = {
|
|
212
|
-
$bs_modal: _propTypes2
|
|
213
|
-
onHide: _propTypes2
|
|
212
|
+
$bs_modal: _propTypes2.default.shape({
|
|
213
|
+
onHide: _propTypes2.default.func
|
|
214
214
|
})
|
|
215
215
|
};
|
|
216
216
|
|
|
217
|
+
/* eslint-disable no-use-before-define, react/no-multi-comp */
|
|
218
|
+
function DialogTransition(props) {
|
|
219
|
+
return _react2.default.createElement(_Fade2.default, (0, _extends3.default)({}, props, { timeout: Modal.TRANSITION_DURATION }));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function BackdropTransition(props) {
|
|
223
|
+
return _react2.default.createElement(_Fade2.default, (0, _extends3.default)({}, props, { timeout: Modal.BACKDROP_TRANSITION_DURATION }));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* eslint-enable no-use-before-define */
|
|
227
|
+
|
|
217
228
|
var Modal = function (_React$Component) {
|
|
218
|
-
(0, _inherits3
|
|
229
|
+
(0, _inherits3.default)(Modal, _React$Component);
|
|
219
230
|
|
|
220
231
|
function Modal(props, context) {
|
|
221
|
-
(0, _classCallCheck3
|
|
232
|
+
(0, _classCallCheck3.default)(this, Modal);
|
|
222
233
|
|
|
223
|
-
var _this = (0, _possibleConstructorReturn3
|
|
234
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, _React$Component.call(this, props, context));
|
|
224
235
|
|
|
225
236
|
_this.handleEntering = _this.handleEntering.bind(_this);
|
|
226
237
|
_this.handleExited = _this.handleExited.bind(_this);
|
|
227
238
|
_this.handleWindowResize = _this.handleWindowResize.bind(_this);
|
|
228
239
|
_this.handleDialogClick = _this.handleDialogClick.bind(_this);
|
|
240
|
+
_this.setModalRef = _this.setModalRef.bind(_this);
|
|
229
241
|
|
|
230
242
|
_this.state = {
|
|
231
243
|
style: {}
|
|
@@ -246,52 +258,54 @@ var Modal = function (_React$Component) {
|
|
|
246
258
|
this.handleExited();
|
|
247
259
|
};
|
|
248
260
|
|
|
261
|
+
Modal.prototype.setModalRef = function setModalRef(ref) {
|
|
262
|
+
this._modal = ref;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
Modal.prototype.handleDialogClick = function handleDialogClick(e) {
|
|
266
|
+
if (e.target !== e.currentTarget) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
this.props.onHide();
|
|
271
|
+
};
|
|
272
|
+
|
|
249
273
|
Modal.prototype.handleEntering = function handleEntering() {
|
|
250
274
|
// FIXME: This should work even when animation is disabled.
|
|
251
|
-
_events2
|
|
275
|
+
_events2.default.on(window, 'resize', this.handleWindowResize);
|
|
252
276
|
this.updateStyle();
|
|
253
277
|
};
|
|
254
278
|
|
|
255
279
|
Modal.prototype.handleExited = function handleExited() {
|
|
256
280
|
// FIXME: This should work even when animation is disabled.
|
|
257
|
-
_events2
|
|
281
|
+
_events2.default.off(window, 'resize', this.handleWindowResize);
|
|
258
282
|
};
|
|
259
283
|
|
|
260
284
|
Modal.prototype.handleWindowResize = function handleWindowResize() {
|
|
261
285
|
this.updateStyle();
|
|
262
286
|
};
|
|
263
287
|
|
|
264
|
-
Modal.prototype.handleDialogClick = function handleDialogClick(e) {
|
|
265
|
-
if (e.target !== e.currentTarget) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
this.props.onHide();
|
|
270
|
-
};
|
|
271
|
-
|
|
272
288
|
Modal.prototype.updateStyle = function updateStyle() {
|
|
273
|
-
if (!_inDOM2
|
|
289
|
+
if (!_inDOM2.default) {
|
|
274
290
|
return;
|
|
275
291
|
}
|
|
276
292
|
|
|
277
293
|
var dialogNode = this._modal.getDialogElement();
|
|
278
294
|
var dialogHeight = dialogNode.scrollHeight;
|
|
279
295
|
|
|
280
|
-
var document = (0, _ownerDocument2
|
|
281
|
-
var bodyIsOverflowing = (0, _isOverflowing2
|
|
296
|
+
var document = (0, _ownerDocument2.default)(dialogNode);
|
|
297
|
+
var bodyIsOverflowing = (0, _isOverflowing2.default)(_reactDom2.default.findDOMNode(this.props.container || document.body));
|
|
282
298
|
var modalIsOverflowing = dialogHeight > document.documentElement.clientHeight;
|
|
283
299
|
|
|
284
300
|
this.setState({
|
|
285
301
|
style: {
|
|
286
|
-
paddingRight: bodyIsOverflowing && !modalIsOverflowing ? (0, _scrollbarSize2
|
|
287
|
-
paddingLeft: !bodyIsOverflowing && modalIsOverflowing ? (0, _scrollbarSize2
|
|
302
|
+
paddingRight: bodyIsOverflowing && !modalIsOverflowing ? (0, _scrollbarSize2.default)() : undefined,
|
|
303
|
+
paddingLeft: !bodyIsOverflowing && modalIsOverflowing ? (0, _scrollbarSize2.default)() : undefined
|
|
288
304
|
}
|
|
289
305
|
});
|
|
290
306
|
};
|
|
291
307
|
|
|
292
308
|
Modal.prototype.render = function render() {
|
|
293
|
-
var _this2 = this;
|
|
294
|
-
|
|
295
309
|
var _props = this.props,
|
|
296
310
|
backdrop = _props.backdrop,
|
|
297
311
|
backdropClassName = _props.backdropClassName,
|
|
@@ -303,35 +317,32 @@ var Modal = function (_React$Component) {
|
|
|
303
317
|
children = _props.children,
|
|
304
318
|
onEntering = _props.onEntering,
|
|
305
319
|
onExited = _props.onExited,
|
|
306
|
-
props = (0, _objectWithoutProperties3
|
|
320
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['backdrop', 'backdropClassName', 'animation', 'show', 'dialogComponentClass', 'className', 'style', 'children', 'onEntering', 'onExited']);
|
|
307
321
|
|
|
308
|
-
var _splitComponentProps = (0, _splitComponentProps3
|
|
322
|
+
var _splitComponentProps = (0, _splitComponentProps3.default)(props, _Modal2.default),
|
|
309
323
|
baseModalProps = _splitComponentProps[0],
|
|
310
324
|
dialogProps = _splitComponentProps[1];
|
|
311
325
|
|
|
312
326
|
var inClassName = show && !animation && 'in';
|
|
313
327
|
|
|
314
|
-
return _react2
|
|
315
|
-
_Modal2
|
|
316
|
-
(0, _extends3
|
|
317
|
-
ref:
|
|
318
|
-
_this2._modal = c;
|
|
319
|
-
},
|
|
328
|
+
return _react2.default.createElement(
|
|
329
|
+
_Modal2.default,
|
|
330
|
+
(0, _extends3.default)({}, baseModalProps, {
|
|
331
|
+
ref: this.setModalRef,
|
|
320
332
|
show: show,
|
|
321
|
-
onEntering: (0, _createChainedFunction2['default'])(onEntering, this.handleEntering),
|
|
322
|
-
onExited: (0, _createChainedFunction2['default'])(onExited, this.handleExited),
|
|
323
|
-
backdrop: backdrop,
|
|
324
|
-
backdropClassName: (0, _classnames2['default'])((0, _bootstrapUtils.prefix)(props, 'backdrop'), backdropClassName, inClassName),
|
|
325
333
|
containerClassName: (0, _bootstrapUtils.prefix)(props, 'open'),
|
|
326
|
-
transition: animation ?
|
|
327
|
-
|
|
328
|
-
|
|
334
|
+
transition: animation ? DialogTransition : undefined,
|
|
335
|
+
backdrop: backdrop,
|
|
336
|
+
backdropTransition: animation ? BackdropTransition : undefined,
|
|
337
|
+
backdropClassName: (0, _classnames2.default)((0, _bootstrapUtils.prefix)(props, 'backdrop'), backdropClassName, inClassName),
|
|
338
|
+
onEntering: (0, _createChainedFunction2.default)(onEntering, this.handleEntering),
|
|
339
|
+
onExited: (0, _createChainedFunction2.default)(onExited, this.handleExited)
|
|
329
340
|
}),
|
|
330
|
-
_react2
|
|
341
|
+
_react2.default.createElement(
|
|
331
342
|
Dialog,
|
|
332
|
-
(0, _extends3
|
|
333
|
-
style: (0, _extends3
|
|
334
|
-
className: (0, _classnames2
|
|
343
|
+
(0, _extends3.default)({}, dialogProps, {
|
|
344
|
+
style: (0, _extends3.default)({}, this.state.style, style),
|
|
345
|
+
className: (0, _classnames2.default)(className, inClassName),
|
|
335
346
|
onClick: backdrop === true ? this.handleDialogClick : null
|
|
336
347
|
}),
|
|
337
348
|
children
|
|
@@ -340,21 +351,21 @@ var Modal = function (_React$Component) {
|
|
|
340
351
|
};
|
|
341
352
|
|
|
342
353
|
return Modal;
|
|
343
|
-
}(_react2
|
|
354
|
+
}(_react2.default.Component);
|
|
344
355
|
|
|
345
356
|
Modal.propTypes = propTypes;
|
|
346
357
|
Modal.defaultProps = defaultProps;
|
|
347
358
|
Modal.childContextTypes = childContextTypes;
|
|
348
359
|
|
|
349
|
-
Modal.Body = _ModalBody2
|
|
350
|
-
Modal.Header = _ModalHeader2
|
|
351
|
-
Modal.Title = _ModalTitle2
|
|
352
|
-
Modal.Footer = _ModalFooter2
|
|
360
|
+
Modal.Body = _ModalBody2.default;
|
|
361
|
+
Modal.Header = _ModalHeader2.default;
|
|
362
|
+
Modal.Title = _ModalTitle2.default;
|
|
363
|
+
Modal.Footer = _ModalFooter2.default;
|
|
353
364
|
|
|
354
|
-
Modal.Dialog = _ModalDialog2
|
|
365
|
+
Modal.Dialog = _ModalDialog2.default;
|
|
355
366
|
|
|
356
367
|
Modal.TRANSITION_DURATION = 300;
|
|
357
368
|
Modal.BACKDROP_TRANSITION_DURATION = 150;
|
|
358
369
|
|
|
359
|
-
exports
|
|
370
|
+
exports.default = (0, _bootstrapUtils.bsClass)('modal', (0, _bootstrapUtils.bsSizes)([_StyleConfig.Size.LARGE, _StyleConfig.Size.SMALL], Modal));
|
|
360
371
|
module.exports = exports['default'];
|
package/lib/ModalBody.js
CHANGED
|
@@ -36,10 +36,10 @@ var _elementType2 = _interopRequireDefault(_elementType);
|
|
|
36
36
|
|
|
37
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
38
|
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
40
|
|
|
41
41
|
var propTypes = {
|
|
42
|
-
componentClass: _elementType2
|
|
42
|
+
componentClass: _elementType2.default
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
var defaultProps = {
|
|
@@ -47,18 +47,18 @@ var defaultProps = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
var ModalBody = function (_React$Component) {
|
|
50
|
-
(0, _inherits3
|
|
50
|
+
(0, _inherits3.default)(ModalBody, _React$Component);
|
|
51
51
|
|
|
52
52
|
function ModalBody() {
|
|
53
|
-
(0, _classCallCheck3
|
|
54
|
-
return (0, _possibleConstructorReturn3
|
|
53
|
+
(0, _classCallCheck3.default)(this, ModalBody);
|
|
54
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
ModalBody.prototype.render = function render() {
|
|
58
58
|
var _props = this.props,
|
|
59
59
|
Component = _props.componentClass,
|
|
60
60
|
className = _props.className,
|
|
61
|
-
props = (0, _objectWithoutProperties3
|
|
61
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['componentClass', 'className']);
|
|
62
62
|
|
|
63
63
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
64
64
|
bsProps = _splitBsProps[0],
|
|
@@ -66,16 +66,14 @@ var ModalBody = function (_React$Component) {
|
|
|
66
66
|
|
|
67
67
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
68
68
|
|
|
69
|
-
return _react2
|
|
70
|
-
className: (0, _classnames2['default'])(className, classes)
|
|
71
|
-
}));
|
|
69
|
+
return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, { className: (0, _classnames2.default)(className, classes) }));
|
|
72
70
|
};
|
|
73
71
|
|
|
74
72
|
return ModalBody;
|
|
75
|
-
}(_react2
|
|
73
|
+
}(_react2.default.Component);
|
|
76
74
|
|
|
77
75
|
ModalBody.propTypes = propTypes;
|
|
78
76
|
ModalBody.defaultProps = defaultProps;
|
|
79
77
|
|
|
80
|
-
exports
|
|
78
|
+
exports.default = (0, _bootstrapUtils.bsClass)('modal-body', ModalBody);
|
|
81
79
|
module.exports = exports['default'];
|
package/lib/ModalDialog.js
CHANGED
|
@@ -38,21 +38,21 @@ var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
|
38
38
|
|
|
39
39
|
var _StyleConfig = require('./utils/StyleConfig');
|
|
40
40
|
|
|
41
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
41
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
42
42
|
|
|
43
43
|
var propTypes = {
|
|
44
44
|
/**
|
|
45
45
|
* A css class to apply to the Modal dialog DOM node.
|
|
46
46
|
*/
|
|
47
|
-
dialogClassName: _propTypes2
|
|
47
|
+
dialogClassName: _propTypes2.default.string
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
var ModalDialog = function (_React$Component) {
|
|
51
|
-
(0, _inherits3
|
|
51
|
+
(0, _inherits3.default)(ModalDialog, _React$Component);
|
|
52
52
|
|
|
53
53
|
function ModalDialog() {
|
|
54
|
-
(0, _classCallCheck3
|
|
55
|
-
return (0, _possibleConstructorReturn3
|
|
54
|
+
(0, _classCallCheck3.default)(this, ModalDialog);
|
|
55
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
ModalDialog.prototype.render = function render() {
|
|
@@ -63,7 +63,7 @@ var ModalDialog = function (_React$Component) {
|
|
|
63
63
|
className = _props.className,
|
|
64
64
|
style = _props.style,
|
|
65
65
|
children = _props.children,
|
|
66
|
-
props = (0, _objectWithoutProperties3
|
|
66
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['dialogClassName', 'className', 'style', 'children']);
|
|
67
67
|
|
|
68
68
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
69
69
|
bsProps = _splitBsProps[0],
|
|
@@ -71,22 +71,22 @@ var ModalDialog = function (_React$Component) {
|
|
|
71
71
|
|
|
72
72
|
var bsClassName = (0, _bootstrapUtils.prefix)(bsProps);
|
|
73
73
|
|
|
74
|
-
var modalStyle = (0, _extends4
|
|
74
|
+
var modalStyle = (0, _extends4.default)({ display: 'block' }, style);
|
|
75
75
|
|
|
76
|
-
var dialogClasses = (0, _extends4
|
|
76
|
+
var dialogClasses = (0, _extends4.default)({}, (0, _bootstrapUtils.getClassSet)(bsProps), (_extends2 = {}, _extends2[bsClassName] = false, _extends2[(0, _bootstrapUtils.prefix)(bsProps, 'dialog')] = true, _extends2));
|
|
77
77
|
|
|
78
|
-
return _react2
|
|
78
|
+
return _react2.default.createElement(
|
|
79
79
|
'div',
|
|
80
|
-
(0, _extends4
|
|
80
|
+
(0, _extends4.default)({}, elementProps, {
|
|
81
81
|
tabIndex: '-1',
|
|
82
82
|
role: 'dialog',
|
|
83
83
|
style: modalStyle,
|
|
84
|
-
className: (0, _classnames2
|
|
84
|
+
className: (0, _classnames2.default)(className, bsClassName)
|
|
85
85
|
}),
|
|
86
|
-
_react2
|
|
86
|
+
_react2.default.createElement(
|
|
87
87
|
'div',
|
|
88
|
-
{ className: (0, _classnames2
|
|
89
|
-
_react2
|
|
88
|
+
{ className: (0, _classnames2.default)(dialogClassName, dialogClasses) },
|
|
89
|
+
_react2.default.createElement(
|
|
90
90
|
'div',
|
|
91
91
|
{ className: (0, _bootstrapUtils.prefix)(bsProps, 'content'), role: 'document' },
|
|
92
92
|
children
|
|
@@ -96,9 +96,9 @@ var ModalDialog = function (_React$Component) {
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
return ModalDialog;
|
|
99
|
-
}(_react2
|
|
99
|
+
}(_react2.default.Component);
|
|
100
100
|
|
|
101
101
|
ModalDialog.propTypes = propTypes;
|
|
102
102
|
|
|
103
|
-
exports
|
|
103
|
+
exports.default = (0, _bootstrapUtils.bsClass)('modal', (0, _bootstrapUtils.bsSizes)([_StyleConfig.Size.LARGE, _StyleConfig.Size.SMALL], ModalDialog));
|
|
104
104
|
module.exports = exports['default'];
|
package/lib/ModalFooter.js
CHANGED
|
@@ -36,10 +36,10 @@ var _elementType2 = _interopRequireDefault(_elementType);
|
|
|
36
36
|
|
|
37
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
38
|
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
40
|
|
|
41
41
|
var propTypes = {
|
|
42
|
-
componentClass: _elementType2
|
|
42
|
+
componentClass: _elementType2.default
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
var defaultProps = {
|
|
@@ -47,18 +47,18 @@ var defaultProps = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
var ModalFooter = function (_React$Component) {
|
|
50
|
-
(0, _inherits3
|
|
50
|
+
(0, _inherits3.default)(ModalFooter, _React$Component);
|
|
51
51
|
|
|
52
52
|
function ModalFooter() {
|
|
53
|
-
(0, _classCallCheck3
|
|
54
|
-
return (0, _possibleConstructorReturn3
|
|
53
|
+
(0, _classCallCheck3.default)(this, ModalFooter);
|
|
54
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
ModalFooter.prototype.render = function render() {
|
|
58
58
|
var _props = this.props,
|
|
59
59
|
Component = _props.componentClass,
|
|
60
60
|
className = _props.className,
|
|
61
|
-
props = (0, _objectWithoutProperties3
|
|
61
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['componentClass', 'className']);
|
|
62
62
|
|
|
63
63
|
var _splitBsProps = (0, _bootstrapUtils.splitBsProps)(props),
|
|
64
64
|
bsProps = _splitBsProps[0],
|
|
@@ -66,16 +66,14 @@ var ModalFooter = function (_React$Component) {
|
|
|
66
66
|
|
|
67
67
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
68
68
|
|
|
69
|
-
return _react2
|
|
70
|
-
className: (0, _classnames2['default'])(className, classes)
|
|
71
|
-
}));
|
|
69
|
+
return _react2.default.createElement(Component, (0, _extends3.default)({}, elementProps, { className: (0, _classnames2.default)(className, classes) }));
|
|
72
70
|
};
|
|
73
71
|
|
|
74
72
|
return ModalFooter;
|
|
75
|
-
}(_react2
|
|
73
|
+
}(_react2.default.Component);
|
|
76
74
|
|
|
77
75
|
ModalFooter.propTypes = propTypes;
|
|
78
76
|
ModalFooter.defaultProps = defaultProps;
|
|
79
77
|
|
|
80
|
-
exports
|
|
78
|
+
exports.default = (0, _bootstrapUtils.bsClass)('modal-footer', ModalFooter);
|
|
81
79
|
module.exports = exports['default'];
|
package/lib/ModalHeader.js
CHANGED
|
@@ -26,14 +26,14 @@ var _classnames = require('classnames');
|
|
|
26
26
|
|
|
27
27
|
var _classnames2 = _interopRequireDefault(_classnames);
|
|
28
28
|
|
|
29
|
-
var _react = require('react');
|
|
30
|
-
|
|
31
|
-
var _react2 = _interopRequireDefault(_react);
|
|
32
|
-
|
|
33
29
|
var _propTypes = require('prop-types');
|
|
34
30
|
|
|
35
31
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
32
|
|
|
33
|
+
var _react = require('react');
|
|
34
|
+
|
|
35
|
+
var _react2 = _interopRequireDefault(_react);
|
|
36
|
+
|
|
37
37
|
var _bootstrapUtils = require('./utils/bootstrapUtils');
|
|
38
38
|
|
|
39
39
|
var _createChainedFunction = require('./utils/createChainedFunction');
|
|
@@ -44,7 +44,7 @@ var _CloseButton = require('./CloseButton');
|
|
|
44
44
|
|
|
45
45
|
var _CloseButton2 = _interopRequireDefault(_CloseButton);
|
|
46
46
|
|
|
47
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
47
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
48
48
|
|
|
49
49
|
// TODO: `aria-label` should be `closeLabel`.
|
|
50
50
|
|
|
@@ -54,19 +54,19 @@ var propTypes = {
|
|
|
54
54
|
* button. It is used for Assistive Technology when the label text is not
|
|
55
55
|
* readable.
|
|
56
56
|
*/
|
|
57
|
-
closeLabel: _propTypes2
|
|
57
|
+
closeLabel: _propTypes2.default.string,
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Specify whether the Component should contain a close button
|
|
61
61
|
*/
|
|
62
|
-
closeButton: _propTypes2
|
|
62
|
+
closeButton: _propTypes2.default.bool,
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* A Callback fired when the close button is clicked. If used directly inside
|
|
66
66
|
* a Modal component, the onHide will automatically be propagated up to the
|
|
67
67
|
* parent Modal `onHide`.
|
|
68
68
|
*/
|
|
69
|
-
onHide: _propTypes2
|
|
69
|
+
onHide: _propTypes2.default.func
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
var defaultProps = {
|
|
@@ -75,17 +75,17 @@ var defaultProps = {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
var contextTypes = {
|
|
78
|
-
$bs_modal: _propTypes2
|
|
79
|
-
onHide: _propTypes2
|
|
78
|
+
$bs_modal: _propTypes2.default.shape({
|
|
79
|
+
onHide: _propTypes2.default.func
|
|
80
80
|
})
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
var ModalHeader = function (_React$Component) {
|
|
84
|
-
(0, _inherits3
|
|
84
|
+
(0, _inherits3.default)(ModalHeader, _React$Component);
|
|
85
85
|
|
|
86
86
|
function ModalHeader() {
|
|
87
|
-
(0, _classCallCheck3
|
|
88
|
-
return (0, _possibleConstructorReturn3
|
|
87
|
+
(0, _classCallCheck3.default)(this, ModalHeader);
|
|
88
|
+
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
ModalHeader.prototype.render = function render() {
|
|
@@ -95,7 +95,7 @@ var ModalHeader = function (_React$Component) {
|
|
|
95
95
|
onHide = _props.onHide,
|
|
96
96
|
className = _props.className,
|
|
97
97
|
children = _props.children,
|
|
98
|
-
props = (0, _objectWithoutProperties3
|
|
98
|
+
props = (0, _objectWithoutProperties3.default)(_props, ['closeLabel', 'closeButton', 'onHide', 'className', 'children']);
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
var modal = this.context.$bs_modal;
|
|
@@ -106,25 +106,23 @@ var ModalHeader = function (_React$Component) {
|
|
|
106
106
|
|
|
107
107
|
var classes = (0, _bootstrapUtils.getClassSet)(bsProps);
|
|
108
108
|
|
|
109
|
-
return _react2
|
|
109
|
+
return _react2.default.createElement(
|
|
110
110
|
'div',
|
|
111
|
-
(0, _extends3
|
|
112
|
-
|
|
113
|
-
}),
|
|
114
|
-
closeButton && _react2['default'].createElement(_CloseButton2['default'], {
|
|
111
|
+
(0, _extends3.default)({}, elementProps, { className: (0, _classnames2.default)(className, classes) }),
|
|
112
|
+
closeButton && _react2.default.createElement(_CloseButton2.default, {
|
|
115
113
|
label: closeLabel,
|
|
116
|
-
onClick: (0, _createChainedFunction2
|
|
114
|
+
onClick: (0, _createChainedFunction2.default)(modal && modal.onHide, onHide)
|
|
117
115
|
}),
|
|
118
116
|
children
|
|
119
117
|
);
|
|
120
118
|
};
|
|
121
119
|
|
|
122
120
|
return ModalHeader;
|
|
123
|
-
}(_react2
|
|
121
|
+
}(_react2.default.Component);
|
|
124
122
|
|
|
125
123
|
ModalHeader.propTypes = propTypes;
|
|
126
124
|
ModalHeader.defaultProps = defaultProps;
|
|
127
125
|
ModalHeader.contextTypes = contextTypes;
|
|
128
126
|
|
|
129
|
-
exports
|
|
127
|
+
exports.default = (0, _bootstrapUtils.bsClass)('modal-header', ModalHeader);
|
|
130
128
|
module.exports = exports['default'];
|