react-bootstrap 0.32.0 → 0.32.4
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 +38 -0
- package/README.md +11 -7
- package/dist/react-bootstrap.js +13464 -13723
- package/dist/react-bootstrap.min.js +10 -18464
- package/es/Accordion.js +13 -16
- package/es/Alert.js +26 -31
- package/es/Badge.js +21 -31
- package/es/Breadcrumb.js +17 -20
- package/es/BreadcrumbItem.js +30 -30
- package/es/Button.js +23 -27
- package/es/ButtonGroup.js +20 -22
- package/es/ButtonToolbar.js +16 -18
- package/es/Carousel.js +120 -157
- package/es/CarouselCaption.js +18 -21
- package/es/CarouselItem.js +34 -33
- package/es/Checkbox.js +43 -54
- package/es/Clearfix.js +24 -24
- package/es/CloseButton.js +21 -30
- package/es/Col.js +42 -26
- package/es/Collapse.js +68 -68
- package/es/ControlLabel.js +19 -24
- package/es/Dropdown.js +93 -91
- package/es/DropdownButton.js +25 -35
- package/es/DropdownMenu.js +65 -65
- package/es/DropdownToggle.js +28 -40
- package/es/Fade.js +26 -29
- package/es/Form.js +22 -22
- package/es/FormControl.js +32 -33
- package/es/FormControlFeedback.js +21 -21
- package/es/FormControlStatic.js +18 -21
- package/es/FormGroup.js +27 -34
- package/es/Glyphicon.js +18 -19
- package/es/Grid.js +20 -22
- package/es/HelpBlock.js +17 -17
- package/es/Image.js +19 -24
- package/es/InputGroup.js +17 -18
- package/es/InputGroupAddon.js +17 -17
- package/es/InputGroupButton.js +17 -17
- package/es/Jumbotron.js +18 -21
- package/es/Label.js +21 -27
- package/es/ListGroup.js +24 -29
- package/es/ListGroupItem.js +30 -48
- package/es/Media.js +18 -22
- package/es/MediaBody.js +19 -22
- package/es/MediaHeading.js +18 -21
- package/es/MediaLeft.js +18 -19
- package/es/MediaList.js +17 -17
- package/es/MediaListItem.js +17 -17
- package/es/MediaRight.js +18 -19
- package/es/MenuItem.js +44 -49
- package/es/Modal.js +63 -74
- package/es/ModalBody.js +18 -21
- package/es/ModalDialog.js +31 -39
- package/es/ModalFooter.js +18 -21
- package/es/ModalHeader.js +25 -35
- package/es/ModalTitle.js +18 -21
- package/es/Nav.js +73 -92
- package/es/NavDropdown.js +40 -52
- package/es/NavItem.js +34 -38
- package/es/Navbar.js +62 -73
- package/es/NavbarBrand.js +20 -24
- package/es/NavbarCollapse.js +21 -28
- package/es/NavbarHeader.js +19 -20
- package/es/NavbarToggle.js +30 -38
- package/es/Overlay.js +21 -25
- package/es/OverlayTrigger.js +71 -68
- package/es/PageHeader.js +18 -26
- package/es/PageItem.js +0 -1
- package/es/Pager.js +23 -30
- package/es/PagerItem.js +36 -40
- package/es/Pagination.js +18 -24
- package/es/PaginationItem.js +47 -57
- package/es/Panel.js +51 -54
- package/es/PanelBody.js +18 -29
- package/es/PanelCollapse.js +20 -23
- package/es/PanelFooter.js +16 -23
- package/es/PanelGroup.js +44 -45
- package/es/PanelHeading.js +19 -28
- package/es/PanelTitle.js +22 -34
- package/es/PanelToggle.js +21 -24
- package/es/Popover.js +36 -46
- package/es/ProgressBar.js +59 -62
- package/es/Radio.js +43 -54
- package/es/ResponsiveEmbed.js +27 -32
- package/es/Row.js +18 -21
- package/es/SafeAnchor.js +32 -32
- package/es/SplitButton.js +33 -46
- package/es/SplitToggle.js +14 -13
- package/es/Tab.js +12 -18
- package/es/TabContainer.js +24 -30
- package/es/TabContent.js +36 -43
- package/es/TabPane.js +58 -68
- package/es/Table.js +25 -29
- package/es/Tabs.js +56 -71
- package/es/Thumbnail.js +34 -34
- package/es/ToggleButton.js +32 -37
- package/es/ToggleButtonGroup.js +45 -57
- package/es/Tooltip.js +33 -40
- package/es/Well.js +17 -17
- package/es/index.js +2 -0
- package/es/utils/PropTypes.js +13 -19
- package/es/utils/StyleConfig.js +0 -4
- package/es/utils/ValidComponentChildren.js +11 -20
- package/es/utils/bootstrapUtils.js +17 -31
- package/es/utils/createChainedFunction.js +2 -2
- package/es/utils/deprecationWarning.js +28 -30
- package/es/utils/splitComponentProps.js +1 -2
- package/lib/Accordion.js +23 -36
- package/lib/Alert.js +43 -65
- package/lib/Badge.js +36 -56
- package/lib/Breadcrumb.js +32 -47
- package/lib/BreadcrumbItem.js +48 -63
- package/lib/Button.js +49 -71
- package/lib/ButtonGroup.js +39 -57
- package/lib/ButtonToolbar.js +29 -42
- package/lib/Carousel.js +161 -214
- package/lib/CarouselCaption.js +32 -46
- package/lib/CarouselItem.js +54 -73
- package/lib/Checkbox.js +64 -87
- package/lib/Clearfix.js +45 -58
- package/lib/CloseButton.js +33 -50
- package/lib/Col.js +78 -73
- package/lib/Collapse.js +104 -125
- package/lib/ControlLabel.js +38 -59
- package/lib/Dropdown.js +153 -192
- package/lib/DropdownButton.js +44 -70
- package/lib/DropdownMenu.js +96 -120
- package/lib/DropdownToggle.js +48 -77
- package/lib/Fade.js +49 -68
- package/lib/Form.js +39 -52
- package/lib/FormControl.js +58 -79
- package/lib/FormControlFeedback.js +42 -54
- package/lib/FormControlStatic.js +32 -46
- package/lib/FormGroup.js +47 -67
- package/lib/Glyphicon.js +33 -46
- package/lib/Grid.js +36 -51
- package/lib/HelpBlock.js +29 -40
- package/lib/Image.js +37 -53
- package/lib/InputGroup.js +34 -49
- package/lib/InputGroupAddon.js +29 -40
- package/lib/InputGroupButton.js +29 -40
- package/lib/Jumbotron.js +32 -46
- package/lib/Label.js +35 -53
- package/lib/ListGroup.js +45 -61
- package/lib/ListGroupItem.js +55 -85
- package/lib/Media.js +43 -70
- package/lib/MediaBody.js +37 -55
- package/lib/MediaHeading.js +32 -46
- package/lib/MediaLeft.js +34 -48
- package/lib/MediaList.js +29 -40
- package/lib/MediaListItem.js +29 -40
- package/lib/MediaRight.js +34 -48
- package/lib/MenuItem.js +70 -92
- package/lib/Modal.js +130 -186
- package/lib/ModalBody.js +32 -46
- package/lib/ModalDialog.js +47 -69
- package/lib/ModalFooter.js +32 -46
- package/lib/ModalHeader.js +43 -70
- package/lib/ModalTitle.js +32 -46
- package/lib/Nav.js +122 -160
- package/lib/NavDropdown.js +63 -97
- package/lib/NavItem.js +54 -77
- package/lib/Navbar.js +115 -152
- package/lib/NavbarBrand.js +37 -55
- package/lib/NavbarCollapse.js +36 -57
- package/lib/NavbarHeader.js +33 -48
- package/lib/NavbarToggle.js +52 -77
- package/lib/Overlay.js +50 -75
- package/lib/OverlayTrigger.js +114 -129
- package/lib/PageHeader.js +30 -49
- package/lib/PageItem.js +9 -10
- package/lib/Pager.js +41 -63
- package/lib/PagerItem.js +55 -78
- package/lib/Pagination.js +32 -50
- package/lib/PaginationItem.js +67 -91
- package/lib/Panel.js +93 -127
- package/lib/PanelBody.js +35 -57
- package/lib/PanelCollapse.js +44 -56
- package/lib/PanelFooter.js +31 -48
- package/lib/PanelGroup.js +73 -88
- package/lib/PanelHeading.js +37 -59
- package/lib/PanelTitle.js +41 -68
- package/lib/PanelToggle.js +45 -66
- package/lib/Popover.js +59 -84
- package/lib/ProgressBar.js +86 -103
- package/lib/Radio.js +64 -87
- package/lib/ResponsiveEmbed.js +45 -63
- package/lib/Row.js +32 -46
- package/lib/SafeAnchor.js +53 -69
- package/lib/SplitButton.js +57 -90
- package/lib/SplitToggle.js +25 -34
- package/lib/Tab.js +32 -55
- package/lib/TabContainer.js +45 -61
- package/lib/TabContent.js +67 -87
- package/lib/TabPane.js +103 -131
- package/lib/Table.js +44 -59
- package/lib/Tabs.js +82 -119
- package/lib/Thumbnail.js +55 -67
- package/lib/ToggleButton.js +49 -68
- package/lib/ToggleButtonGroup.js +67 -104
- package/lib/Tooltip.js +55 -77
- package/lib/Well.js +30 -41
- package/lib/index.js +147 -214
- package/lib/utils/PropTypes.js +24 -31
- package/lib/utils/StyleConfig.js +13 -11
- package/lib/utils/ValidComponentChildren.js +34 -29
- package/lib/utils/bootstrapUtils.js +41 -52
- package/lib/utils/capitalize.js +2 -0
- package/lib/utils/createChainedFunction.js +8 -5
- package/lib/utils/deprecationWarning.js +37 -47
- package/lib/utils/index.js +11 -15
- package/lib/utils/splitComponentProps.js +5 -10
- package/package.json +58 -50
package/es/Modal.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import _extends from 'babel-runtime/helpers/extends';
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime-corejs2/helpers/esm/assertThisInitialized";
|
|
4
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import events from 'dom-helpers/events';
|
|
8
7
|
import ownerDocument from 'dom-helpers/ownerDocument';
|
|
@@ -14,7 +13,6 @@ import ReactDOM from 'react-dom';
|
|
|
14
13
|
import BaseModal from 'react-overlays/lib/Modal';
|
|
15
14
|
import isOverflowing from 'react-overlays/lib/utils/isOverflowing';
|
|
16
15
|
import elementType from 'prop-types-extra/lib/elementType';
|
|
17
|
-
|
|
18
16
|
import Fade from './Fade';
|
|
19
17
|
import Body from './ModalBody';
|
|
20
18
|
import ModalDialog from './ModalDialog';
|
|
@@ -27,7 +25,6 @@ import splitComponentProps from './utils/splitComponentProps';
|
|
|
27
25
|
import { Size } from './utils/StyleConfig';
|
|
28
26
|
|
|
29
27
|
var propTypes = _extends({}, BaseModal.propTypes, ModalDialog.propTypes, {
|
|
30
|
-
|
|
31
28
|
/**
|
|
32
29
|
* Include a backdrop component. Specify 'static' for a backdrop that doesn't
|
|
33
30
|
* trigger an "onHide" when clicked.
|
|
@@ -135,39 +132,45 @@ var childContextTypes = {
|
|
|
135
132
|
onHide: PropTypes.func
|
|
136
133
|
})
|
|
137
134
|
};
|
|
138
|
-
|
|
139
135
|
/* eslint-disable no-use-before-define, react/no-multi-comp */
|
|
136
|
+
|
|
140
137
|
function DialogTransition(props) {
|
|
141
|
-
return React.createElement(Fade, _extends({}, props, {
|
|
138
|
+
return React.createElement(Fade, _extends({}, props, {
|
|
139
|
+
timeout: Modal.TRANSITION_DURATION
|
|
140
|
+
}));
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
function BackdropTransition(props) {
|
|
145
|
-
return React.createElement(Fade, _extends({}, props, {
|
|
144
|
+
return React.createElement(Fade, _extends({}, props, {
|
|
145
|
+
timeout: Modal.BACKDROP_TRANSITION_DURATION
|
|
146
|
+
}));
|
|
146
147
|
}
|
|
147
|
-
|
|
148
148
|
/* eslint-enable no-use-before-define */
|
|
149
149
|
|
|
150
|
-
var Modal = function (_React$Component) {
|
|
151
|
-
_inherits(Modal, _React$Component);
|
|
152
150
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
_this.handleEntering = _this.handleEntering.bind(_this);
|
|
159
|
-
_this.handleExited = _this.handleExited.bind(_this);
|
|
160
|
-
_this.handleWindowResize = _this.handleWindowResize.bind(_this);
|
|
161
|
-
_this.handleDialogClick = _this.handleDialogClick.bind(_this);
|
|
162
|
-
_this.setModalRef = _this.setModalRef.bind(_this);
|
|
151
|
+
var Modal =
|
|
152
|
+
/*#__PURE__*/
|
|
153
|
+
function (_React$Component) {
|
|
154
|
+
_inheritsLoose(Modal, _React$Component);
|
|
163
155
|
|
|
156
|
+
function Modal(props, context) {
|
|
157
|
+
var _this;
|
|
158
|
+
|
|
159
|
+
_this = _React$Component.call(this, props, context) || this;
|
|
160
|
+
_this.handleEntering = _this.handleEntering.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
161
|
+
_this.handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
162
|
+
_this.handleWindowResize = _this.handleWindowResize.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
163
|
+
_this.handleDialogClick = _this.handleDialogClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
164
|
+
_this.setModalRef = _this.setModalRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
|
|
164
165
|
_this.state = {
|
|
165
166
|
style: {}
|
|
166
167
|
};
|
|
167
168
|
return _this;
|
|
168
169
|
}
|
|
169
170
|
|
|
170
|
-
Modal.prototype
|
|
171
|
+
var _proto = Modal.prototype;
|
|
172
|
+
|
|
173
|
+
_proto.getChildContext = function getChildContext() {
|
|
171
174
|
return {
|
|
172
175
|
$bs_modal: {
|
|
173
176
|
onHide: this.props.onHide
|
|
@@ -175,16 +178,16 @@ var Modal = function (_React$Component) {
|
|
|
175
178
|
};
|
|
176
179
|
};
|
|
177
180
|
|
|
178
|
-
|
|
181
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
179
182
|
// Clean up the listener if we need to.
|
|
180
183
|
this.handleExited();
|
|
181
184
|
};
|
|
182
185
|
|
|
183
|
-
|
|
186
|
+
_proto.setModalRef = function setModalRef(ref) {
|
|
184
187
|
this._modal = ref;
|
|
185
188
|
};
|
|
186
189
|
|
|
187
|
-
|
|
190
|
+
_proto.handleDialogClick = function handleDialogClick(e) {
|
|
188
191
|
if (e.target !== e.currentTarget) {
|
|
189
192
|
return;
|
|
190
193
|
}
|
|
@@ -192,33 +195,32 @@ var Modal = function (_React$Component) {
|
|
|
192
195
|
this.props.onHide();
|
|
193
196
|
};
|
|
194
197
|
|
|
195
|
-
|
|
198
|
+
_proto.handleEntering = function handleEntering() {
|
|
196
199
|
// FIXME: This should work even when animation is disabled.
|
|
197
200
|
events.on(window, 'resize', this.handleWindowResize);
|
|
198
201
|
this.updateStyle();
|
|
199
202
|
};
|
|
200
203
|
|
|
201
|
-
|
|
204
|
+
_proto.handleExited = function handleExited() {
|
|
202
205
|
// FIXME: This should work even when animation is disabled.
|
|
203
206
|
events.off(window, 'resize', this.handleWindowResize);
|
|
204
207
|
};
|
|
205
208
|
|
|
206
|
-
|
|
209
|
+
_proto.handleWindowResize = function handleWindowResize() {
|
|
207
210
|
this.updateStyle();
|
|
208
211
|
};
|
|
209
212
|
|
|
210
|
-
|
|
213
|
+
_proto.updateStyle = function updateStyle() {
|
|
211
214
|
if (!canUseDOM) {
|
|
212
215
|
return;
|
|
213
216
|
}
|
|
214
217
|
|
|
215
218
|
var dialogNode = this._modal.getDialogElement();
|
|
216
|
-
var dialogHeight = dialogNode.scrollHeight;
|
|
217
219
|
|
|
220
|
+
var dialogHeight = dialogNode.scrollHeight;
|
|
218
221
|
var document = ownerDocument(dialogNode);
|
|
219
222
|
var bodyIsOverflowing = isOverflowing(ReactDOM.findDOMNode(this.props.container || document.body));
|
|
220
223
|
var modalIsOverflowing = dialogHeight > document.documentElement.clientHeight;
|
|
221
|
-
|
|
222
224
|
this.setState({
|
|
223
225
|
style: {
|
|
224
226
|
paddingRight: bodyIsOverflowing && !modalIsOverflowing ? getScrollbarSize() : undefined,
|
|
@@ -227,49 +229,40 @@ var Modal = function (_React$Component) {
|
|
|
227
229
|
});
|
|
228
230
|
};
|
|
229
231
|
|
|
230
|
-
|
|
231
|
-
var
|
|
232
|
-
backdrop =
|
|
233
|
-
backdropClassName =
|
|
234
|
-
animation =
|
|
235
|
-
show =
|
|
236
|
-
Dialog =
|
|
237
|
-
className =
|
|
238
|
-
style =
|
|
239
|
-
children =
|
|
240
|
-
onEntering =
|
|
241
|
-
onExited =
|
|
242
|
-
props =
|
|
232
|
+
_proto.render = function render() {
|
|
233
|
+
var _this$props = this.props,
|
|
234
|
+
backdrop = _this$props.backdrop,
|
|
235
|
+
backdropClassName = _this$props.backdropClassName,
|
|
236
|
+
animation = _this$props.animation,
|
|
237
|
+
show = _this$props.show,
|
|
238
|
+
Dialog = _this$props.dialogComponentClass,
|
|
239
|
+
className = _this$props.className,
|
|
240
|
+
style = _this$props.style,
|
|
241
|
+
children = _this$props.children,
|
|
242
|
+
onEntering = _this$props.onEntering,
|
|
243
|
+
onExited = _this$props.onExited,
|
|
244
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["backdrop", "backdropClassName", "animation", "show", "dialogComponentClass", "className", "style", "children", "onEntering", "onExited"]);
|
|
243
245
|
|
|
244
246
|
var _splitComponentProps = splitComponentProps(props, BaseModal),
|
|
245
247
|
baseModalProps = _splitComponentProps[0],
|
|
246
248
|
dialogProps = _splitComponentProps[1];
|
|
247
249
|
|
|
248
250
|
var inClassName = show && !animation && 'in';
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
Dialog,
|
|
265
|
-
_extends({}, dialogProps, {
|
|
266
|
-
style: _extends({}, this.state.style, style),
|
|
267
|
-
className: classNames(className, inClassName),
|
|
268
|
-
onClick: backdrop === true ? this.handleDialogClick : null
|
|
269
|
-
}),
|
|
270
|
-
children
|
|
271
|
-
)
|
|
272
|
-
);
|
|
251
|
+
return React.createElement(BaseModal, _extends({}, baseModalProps, {
|
|
252
|
+
ref: this.setModalRef,
|
|
253
|
+
show: show,
|
|
254
|
+
containerClassName: prefix(props, 'open'),
|
|
255
|
+
transition: animation ? DialogTransition : undefined,
|
|
256
|
+
backdrop: backdrop,
|
|
257
|
+
backdropTransition: animation ? BackdropTransition : undefined,
|
|
258
|
+
backdropClassName: classNames(prefix(props, 'backdrop'), backdropClassName, inClassName),
|
|
259
|
+
onEntering: createChainedFunction(onEntering, this.handleEntering),
|
|
260
|
+
onExited: createChainedFunction(onExited, this.handleExited)
|
|
261
|
+
}), React.createElement(Dialog, _extends({}, dialogProps, {
|
|
262
|
+
style: _extends({}, this.state.style, style),
|
|
263
|
+
className: classNames(className, inClassName),
|
|
264
|
+
onClick: backdrop === true ? this.handleDialogClick : null
|
|
265
|
+
}), children));
|
|
273
266
|
};
|
|
274
267
|
|
|
275
268
|
return Modal;
|
|
@@ -278,15 +271,11 @@ var Modal = function (_React$Component) {
|
|
|
278
271
|
Modal.propTypes = propTypes;
|
|
279
272
|
Modal.defaultProps = defaultProps;
|
|
280
273
|
Modal.childContextTypes = childContextTypes;
|
|
281
|
-
|
|
282
274
|
Modal.Body = Body;
|
|
283
275
|
Modal.Header = Header;
|
|
284
276
|
Modal.Title = Title;
|
|
285
277
|
Modal.Footer = Footer;
|
|
286
|
-
|
|
287
278
|
Modal.Dialog = ModalDialog;
|
|
288
|
-
|
|
289
279
|
Modal.TRANSITION_DURATION = 300;
|
|
290
280
|
Modal.BACKDROP_TRANSITION_DURATION = 150;
|
|
291
|
-
|
|
292
281
|
export default bsClass('modal', bsSizes([Size.LARGE, Size.SMALL], Modal));
|
package/es/ModalBody.js
CHANGED
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import elementType from 'prop-types-extra/lib/elementType';
|
|
9
|
-
|
|
10
7
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
11
|
-
|
|
12
8
|
var propTypes = {
|
|
13
9
|
componentClass: elementType
|
|
14
10
|
};
|
|
15
|
-
|
|
16
11
|
var defaultProps = {
|
|
17
12
|
componentClass: 'div'
|
|
18
13
|
};
|
|
19
14
|
|
|
20
|
-
var ModalBody =
|
|
21
|
-
|
|
15
|
+
var ModalBody =
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
function (_React$Component) {
|
|
18
|
+
_inheritsLoose(ModalBody, _React$Component);
|
|
22
19
|
|
|
23
20
|
function ModalBody() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
21
|
+
return _React$Component.apply(this, arguments) || this;
|
|
27
22
|
}
|
|
28
23
|
|
|
29
|
-
ModalBody.prototype
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
var _proto = ModalBody.prototype;
|
|
25
|
+
|
|
26
|
+
_proto.render = function render() {
|
|
27
|
+
var _this$props = this.props,
|
|
28
|
+
Component = _this$props.componentClass,
|
|
29
|
+
className = _this$props.className,
|
|
30
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "className"]);
|
|
34
31
|
|
|
35
32
|
var _splitBsProps = splitBsProps(props),
|
|
36
33
|
bsProps = _splitBsProps[0],
|
|
37
34
|
elementProps = _splitBsProps[1];
|
|
38
35
|
|
|
39
36
|
var classes = getClassSet(bsProps);
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
38
|
+
className: classNames(className, classes)
|
|
39
|
+
}));
|
|
42
40
|
};
|
|
43
41
|
|
|
44
42
|
return ModalBody;
|
|
@@ -46,5 +44,4 @@ var ModalBody = function (_React$Component) {
|
|
|
46
44
|
|
|
47
45
|
ModalBody.propTypes = propTypes;
|
|
48
46
|
ModalBody.defaultProps = defaultProps;
|
|
49
|
-
|
|
50
47
|
export default bsClass('modal-body', ModalBody);
|
package/es/ModalDialog.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
|
-
|
|
10
7
|
import { bsClass, bsSizes, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
|
11
8
|
import { Size } from './utils/StyleConfig';
|
|
12
|
-
|
|
13
9
|
var propTypes = {
|
|
14
10
|
/**
|
|
15
11
|
* A css class to apply to the Modal dialog DOM node.
|
|
@@ -17,24 +13,26 @@ var propTypes = {
|
|
|
17
13
|
dialogClassName: PropTypes.string
|
|
18
14
|
};
|
|
19
15
|
|
|
20
|
-
var ModalDialog =
|
|
21
|
-
|
|
16
|
+
var ModalDialog =
|
|
17
|
+
/*#__PURE__*/
|
|
18
|
+
function (_React$Component) {
|
|
19
|
+
_inheritsLoose(ModalDialog, _React$Component);
|
|
22
20
|
|
|
23
21
|
function ModalDialog() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
22
|
+
return _React$Component.apply(this, arguments) || this;
|
|
27
23
|
}
|
|
28
24
|
|
|
29
|
-
ModalDialog.prototype
|
|
25
|
+
var _proto = ModalDialog.prototype;
|
|
26
|
+
|
|
27
|
+
_proto.render = function render() {
|
|
30
28
|
var _extends2;
|
|
31
29
|
|
|
32
|
-
var
|
|
33
|
-
dialogClassName =
|
|
34
|
-
className =
|
|
35
|
-
style =
|
|
36
|
-
children =
|
|
37
|
-
props =
|
|
30
|
+
var _this$props = this.props,
|
|
31
|
+
dialogClassName = _this$props.dialogClassName,
|
|
32
|
+
className = _this$props.className,
|
|
33
|
+
style = _this$props.style,
|
|
34
|
+
children = _this$props.children,
|
|
35
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["dialogClassName", "className", "style", "children"]);
|
|
38
36
|
|
|
39
37
|
var _splitBsProps = splitBsProps(props),
|
|
40
38
|
bsProps = _splitBsProps[0],
|
|
@@ -42,33 +40,27 @@ var ModalDialog = function (_React$Component) {
|
|
|
42
40
|
|
|
43
41
|
var bsClassName = prefix(bsProps);
|
|
44
42
|
|
|
45
|
-
var modalStyle = _extends({
|
|
43
|
+
var modalStyle = _extends({
|
|
44
|
+
display: 'block'
|
|
45
|
+
}, style);
|
|
46
46
|
|
|
47
47
|
var dialogClasses = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[bsClassName] = false, _extends2[prefix(bsProps, 'dialog')] = true, _extends2));
|
|
48
48
|
|
|
49
|
-
return React.createElement(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
React.createElement(
|
|
61
|
-
'div',
|
|
62
|
-
{ className: prefix(bsProps, 'content'), role: 'document' },
|
|
63
|
-
children
|
|
64
|
-
)
|
|
65
|
-
)
|
|
66
|
-
);
|
|
49
|
+
return React.createElement("div", _extends({}, elementProps, {
|
|
50
|
+
tabIndex: "-1",
|
|
51
|
+
role: "dialog",
|
|
52
|
+
style: modalStyle,
|
|
53
|
+
className: classNames(className, bsClassName)
|
|
54
|
+
}), React.createElement("div", {
|
|
55
|
+
className: classNames(dialogClassName, dialogClasses)
|
|
56
|
+
}, React.createElement("div", {
|
|
57
|
+
className: prefix(bsProps, 'content'),
|
|
58
|
+
role: "document"
|
|
59
|
+
}, children)));
|
|
67
60
|
};
|
|
68
61
|
|
|
69
62
|
return ModalDialog;
|
|
70
63
|
}(React.Component);
|
|
71
64
|
|
|
72
65
|
ModalDialog.propTypes = propTypes;
|
|
73
|
-
|
|
74
66
|
export default bsClass('modal', bsSizes([Size.LARGE, Size.SMALL], ModalDialog));
|
package/es/ModalFooter.js
CHANGED
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import elementType from 'prop-types-extra/lib/elementType';
|
|
9
|
-
|
|
10
7
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
11
|
-
|
|
12
8
|
var propTypes = {
|
|
13
9
|
componentClass: elementType
|
|
14
10
|
};
|
|
15
|
-
|
|
16
11
|
var defaultProps = {
|
|
17
12
|
componentClass: 'div'
|
|
18
13
|
};
|
|
19
14
|
|
|
20
|
-
var ModalFooter =
|
|
21
|
-
|
|
15
|
+
var ModalFooter =
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
function (_React$Component) {
|
|
18
|
+
_inheritsLoose(ModalFooter, _React$Component);
|
|
22
19
|
|
|
23
20
|
function ModalFooter() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
21
|
+
return _React$Component.apply(this, arguments) || this;
|
|
27
22
|
}
|
|
28
23
|
|
|
29
|
-
ModalFooter.prototype
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
var _proto = ModalFooter.prototype;
|
|
25
|
+
|
|
26
|
+
_proto.render = function render() {
|
|
27
|
+
var _this$props = this.props,
|
|
28
|
+
Component = _this$props.componentClass,
|
|
29
|
+
className = _this$props.className,
|
|
30
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "className"]);
|
|
34
31
|
|
|
35
32
|
var _splitBsProps = splitBsProps(props),
|
|
36
33
|
bsProps = _splitBsProps[0],
|
|
37
34
|
elementProps = _splitBsProps[1];
|
|
38
35
|
|
|
39
36
|
var classes = getClassSet(bsProps);
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
38
|
+
className: classNames(className, classes)
|
|
39
|
+
}));
|
|
42
40
|
};
|
|
43
41
|
|
|
44
42
|
return ModalFooter;
|
|
@@ -46,5 +44,4 @@ var ModalFooter = function (_React$Component) {
|
|
|
46
44
|
|
|
47
45
|
ModalFooter.propTypes = propTypes;
|
|
48
46
|
ModalFooter.defaultProps = defaultProps;
|
|
49
|
-
|
|
50
47
|
export default bsClass('modal-footer', ModalFooter);
|
package/es/ModalHeader.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import React from 'react';
|
|
9
|
-
|
|
10
7
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
11
8
|
import createChainedFunction from './utils/createChainedFunction';
|
|
12
|
-
import CloseButton from './CloseButton';
|
|
13
|
-
|
|
14
|
-
// TODO: `aria-label` should be `closeLabel`.
|
|
9
|
+
import CloseButton from './CloseButton'; // TODO: `aria-label` should be `closeLabel`.
|
|
15
10
|
|
|
16
11
|
var propTypes = {
|
|
17
12
|
/**
|
|
@@ -33,35 +28,35 @@ var propTypes = {
|
|
|
33
28
|
*/
|
|
34
29
|
onHide: PropTypes.func
|
|
35
30
|
};
|
|
36
|
-
|
|
37
31
|
var defaultProps = {
|
|
38
32
|
closeLabel: 'Close',
|
|
39
33
|
closeButton: false
|
|
40
34
|
};
|
|
41
|
-
|
|
42
35
|
var contextTypes = {
|
|
43
36
|
$bs_modal: PropTypes.shape({
|
|
44
37
|
onHide: PropTypes.func
|
|
45
38
|
})
|
|
46
39
|
};
|
|
47
40
|
|
|
48
|
-
var ModalHeader =
|
|
49
|
-
|
|
41
|
+
var ModalHeader =
|
|
42
|
+
/*#__PURE__*/
|
|
43
|
+
function (_React$Component) {
|
|
44
|
+
_inheritsLoose(ModalHeader, _React$Component);
|
|
50
45
|
|
|
51
46
|
function ModalHeader() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
47
|
+
return _React$Component.apply(this, arguments) || this;
|
|
55
48
|
}
|
|
56
49
|
|
|
57
|
-
ModalHeader.prototype
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
var _proto = ModalHeader.prototype;
|
|
51
|
+
|
|
52
|
+
_proto.render = function render() {
|
|
53
|
+
var _this$props = this.props,
|
|
54
|
+
closeLabel = _this$props.closeLabel,
|
|
55
|
+
closeButton = _this$props.closeButton,
|
|
56
|
+
onHide = _this$props.onHide,
|
|
57
|
+
className = _this$props.className,
|
|
58
|
+
children = _this$props.children,
|
|
59
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["closeLabel", "closeButton", "onHide", "className", "children"]);
|
|
65
60
|
|
|
66
61
|
var modal = this.context.$bs_modal;
|
|
67
62
|
|
|
@@ -70,16 +65,12 @@ var ModalHeader = function (_React$Component) {
|
|
|
70
65
|
elementProps = _splitBsProps[1];
|
|
71
66
|
|
|
72
67
|
var classes = getClassSet(bsProps);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
onClick: createChainedFunction(modal && modal.onHide, onHide)
|
|
80
|
-
}),
|
|
81
|
-
children
|
|
82
|
-
);
|
|
68
|
+
return React.createElement("div", _extends({}, elementProps, {
|
|
69
|
+
className: classNames(className, classes)
|
|
70
|
+
}), closeButton && React.createElement(CloseButton, {
|
|
71
|
+
label: closeLabel,
|
|
72
|
+
onClick: createChainedFunction(modal && modal.onHide, onHide)
|
|
73
|
+
}), children);
|
|
83
74
|
};
|
|
84
75
|
|
|
85
76
|
return ModalHeader;
|
|
@@ -88,5 +79,4 @@ var ModalHeader = function (_React$Component) {
|
|
|
88
79
|
ModalHeader.propTypes = propTypes;
|
|
89
80
|
ModalHeader.defaultProps = defaultProps;
|
|
90
81
|
ModalHeader.contextTypes = contextTypes;
|
|
91
|
-
|
|
92
82
|
export default bsClass('modal-header', ModalHeader);
|
package/es/ModalTitle.js
CHANGED
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
import _extends from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
|
5
|
-
import _inherits from 'babel-runtime/helpers/inherits';
|
|
1
|
+
import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
|
6
4
|
import classNames from 'classnames';
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import elementType from 'prop-types-extra/lib/elementType';
|
|
9
|
-
|
|
10
7
|
import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
|
11
|
-
|
|
12
8
|
var propTypes = {
|
|
13
9
|
componentClass: elementType
|
|
14
10
|
};
|
|
15
|
-
|
|
16
11
|
var defaultProps = {
|
|
17
12
|
componentClass: 'h4'
|
|
18
13
|
};
|
|
19
14
|
|
|
20
|
-
var ModalTitle =
|
|
21
|
-
|
|
15
|
+
var ModalTitle =
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
function (_React$Component) {
|
|
18
|
+
_inheritsLoose(ModalTitle, _React$Component);
|
|
22
19
|
|
|
23
20
|
function ModalTitle() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
21
|
+
return _React$Component.apply(this, arguments) || this;
|
|
27
22
|
}
|
|
28
23
|
|
|
29
|
-
ModalTitle.prototype
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
var _proto = ModalTitle.prototype;
|
|
25
|
+
|
|
26
|
+
_proto.render = function render() {
|
|
27
|
+
var _this$props = this.props,
|
|
28
|
+
Component = _this$props.componentClass,
|
|
29
|
+
className = _this$props.className,
|
|
30
|
+
props = _objectWithoutPropertiesLoose(_this$props, ["componentClass", "className"]);
|
|
34
31
|
|
|
35
32
|
var _splitBsProps = splitBsProps(props),
|
|
36
33
|
bsProps = _splitBsProps[0],
|
|
37
34
|
elementProps = _splitBsProps[1];
|
|
38
35
|
|
|
39
36
|
var classes = getClassSet(bsProps);
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
return React.createElement(Component, _extends({}, elementProps, {
|
|
38
|
+
className: classNames(className, classes)
|
|
39
|
+
}));
|
|
42
40
|
};
|
|
43
41
|
|
|
44
42
|
return ModalTitle;
|
|
@@ -46,5 +44,4 @@ var ModalTitle = function (_React$Component) {
|
|
|
46
44
|
|
|
47
45
|
ModalTitle.propTypes = propTypes;
|
|
48
46
|
ModalTitle.defaultProps = defaultProps;
|
|
49
|
-
|
|
50
47
|
export default bsClass('modal-title', ModalTitle);
|